Commit 48d77ffe by 李嘉林

无用代码删除

parent d3354a5a
......@@ -19,15 +19,15 @@ exports.cssLoaders = function (options) {
var cssLoader = {
loader: 'css-loader',
options: {
minimize: (process.env.NODE_ENV === 'production' || process.env.NODE_ENV == 'xhyx_prod'),
sourceMap: options.sourceMap
minimize: true,
sourceMap: false
}
}
var postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: true
sourceMap: false
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -33,8 +33,6 @@
"mayi-front-tools": "^1.0.3",
"mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5",
"posthog-js": "^1.39.1",
"posthog-node": "^2.2.3",
"sa-sdk-miniprogram": "^1.20.2",
"vuex": "^3.0.1",
"we-cropper": "^1.4.0",
......
<template>
<!-- 视频组件 -->
<div class="video-player">
<div class="title" v-if="datas.componentData['title']">
<p>{{datas.componentData['title']}}</p>
</div>
<div class="main">
<!-- url展示 -->
<div class="isVideo" v-show="datas.componentData['type']<3">
<video
bindplay="pauseVideo"
bindended="videoEnd"
ref="videoPlayer"
:show-center-play-btn="isPlay&&!datas.componentData['nativeControl']?true:false"
type="video/mp4"
width="100%"
:src="videoUrl"
:loop="datas.componentData['loopPlay']"
:controls="datas.componentData['nativeControl']"
:webkit-playsinline="true"
:x5-video-player-type="'h5-page'"
:x5-video-player-fullscreen="true"
:playsinline="true"
:poster="videoPoster"
></video>
</div>
<!-- 代码片段展示 -->
<div
class="isCodeSnippets"
v-show="datas.componentData['type']==3&&datas.componentData['codeSnippet']!=''"
>
<wxParse :content="datas.componentData['codeSnippet']" />
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import wxParse from 'mpvue-wxparse'
export default {
name: "video-player",
props: {
datas: {
type: Object,
default: function() {
return {
id: "",
pageCode: 0,
pageType: 0,
queueNumber: 0,
componentName: "视频",
componentCode: "video-player",
code: 1,
componentData: {
// 1:手动上传 2:网络地址 3:代码片段
type: 1,
// 是否展示原生控件
nativeControl: false,
// 是否循环播放
loopPlay: false,
// 是否全屏播放
fullScreenPlay: false,
title: "视频",
videoUrl: "",
codeSnippet: ""
}
};
}
}
},
components: {
wxParse
},
data() {
return {
isPlay: true
};
},
watch: {
videoUrl() {
this.$refs.videoPlayer.src = this.videoUrl;
},
videoPoster(){
this.$refs.videoPlayer.poster = this.videoPoster;
this.$refs.videoPlayer.src = this.videoUrl;
}
},
computed: {
videoUrl() {
return this.datas.componentData["videoUrl"];
},
videoPoster() {
return this.datas.componentData["poster"];
}
},
created() {},
mounted() {},
methods: {
// 播放暂停
pauseVideo() {
if(this.datas.componentData['nativeControl'])return;
this.$refs.videoPlayer.pause();
this.isPlay = true;
},
// 播放开始
playVideo() {
if(!this.render)return;
this.$refs.videoPlayer.play();
this.isPlay = false;
},
// 播放结束
videoEnd(){
if(!this.datas.componentData['nativeControl']){
this.isPlay=true;
}
}
}
};
</script>
<style lang="scss" scoped>
@import url("~mpvue-wxparse/src/wxParse.css");
.video-player {
.title {
font-size: 18px;
padding: 10px 20px;
color: #333;
font-weight: bold;
}
.main {
width: 100%;
.isVideo {
width: 100%;
position: relative;
.playerBtn {
position: absolute;
top: 50%;
left: 50%;
width: 60px;
height: 60px;
margin-top: -30px;
margin-left: -30px;
border-radius: 50%;
overflow: hidden;
img {
width: 60px;
height: 60px;
}
}
video{
width:100%;
}
}
.isCodeSnippets {
width: 100%;
video{
width: 100%;
}
}
}
}
</style>
<template>
<div class="mpvueCropper">
<div class="canvasBg">
<canvas
v-if="_canvasId"
:canvasId="_canvasId"
@touchstart="touchstart"
@touchmove="touchmove"
@touchend="touchend"
disable-scroll
:style="{
width: _width + 'px',
height: _height + 'px',
background: 'rgba(0, 0, 0, .8)',
}"
>
</canvas>
<canvas
v-if="_targetId"
:canvas-id="_targetId"
disable-scroll
:style="{
position: 'fixed',
top: -_width * _pixelRatio + 'px',
left: -_height * _pixelRatio + 'px',
width: _width * _pixelRatio + 'px',
height: _height * _pixelRatio + 'px',
}"
>
</canvas>
</div>
<div class="btn flex">
<div class="btn-cont flex">
<div class="cancel" @click="cancelSelect">取消</div>
<div @click="selectImg">确定</div>
</div>
</div>
</div>
</template>
<script>
import WeCropper from "we-cropper";
import index from "@/api/index";
export default {
name: "mpvue-cropper",
props: {
option: {
type: Object,
},
},
data() {
return {
_wecropper: null,
selectImgUrl: "",
ossConfig: {},
};
},
computed: {
_canvasId() {
return this.option.id;
},
_targetId() {
return this.option.targetId;
},
_width() {
return this.option.width;
},
_height() {
return this.option.height;
},
_pixelRatio() {
return this.option.pixelRatio;
},
},
methods: {
touchstart($event) {
this._wecropper.touchStart($event.mp);
},
touchmove($event) {
this._wecropper.touchMove($event.mp);
},
touchend($event) {
this._wecropper.touchEnd($event.mp);
},
pushOrigin(src) {
this._wecropper.pushOrign(src);
},
updateCanvas() {
this._wecropper.updateCanvas();
},
getCropperBase64(fn) {
return this._wecropper.getCropperBase64(fn);
},
getCropperImage(opt, fn) {
return this._wecropper.getCropperImage(opt, fn);
},
init() {
console.log(this.option.src, "-----------97");
this._wecropper = new WeCropper(
Object.assign(this.option, {
id: this._canvasId,
targetId: this._targetId,
pixelRatio: this._pixelRatio,
})
)
.on("ready", (...args) => {
this.$emit("ready", ...args);
})
.on("beforeImageLoad", (...args) => {
this.$emit("beforeImageLoad", ...args);
})
.on("imageLoad", (...args) => {
this.$emit("imageLoad", ...args);
})
.on("beforeDraw", (...args) => {
this.$emit("beforeDraw", ...args);
});
},
selectImg() {
let _this = this;
this._wecropper.getCropperImage().then((path) => {
console.log(path, "---path");
wx.showLoading({
title: "生成中...",
});
this.fileName = `${_this.ossConfig.dir}${path.split('/')[path.split('/').length-1]}`
wx.uploadFile({
url: `${ _this.ossConfig.host}`,
filePath: path,
name: "file",
formData: {
key: _this.fileName,
OSSAccessKeyId: _this.ossConfig.accessid,
policy: _this.ossConfig.policy,
signature: _this.ossConfig.signature,
success_action_status: "200",
},
success(res) {
console.log(res, "-----------118--success");
if (res.statusCode == 200) {
let host = _this.ossConfig.host.substr(-1) == '/'?_this.ossConfig.host:`${_this.ossConfig.host}/`
_this.selectImgUrl = `${host}${_this.fileName}`;
wx.setStorageSync("wo-selectImgUrl", _this.selectImgUrl);
wx.hideLoading();
wx.showToast({
title: "成功",
icon: "success",
duration: 1000,
});
setTimeout(() => {
wx.navigateBack();
}, 1000);
} else {
wx.showToast({
title: "生成失败",
icon: "error",
duration: 1000,
});
}
//do something
},
fail(res) {
console.log(res, "-----------------fail");
wx.showToast({
title: "生成失败",
icon: "error",
duration: 1000,
});
},
});
});
},
cancelSelect() {
// this.$emit("cancelSelect");
wx.navigateBack();
},
get_oss_config() {
console.log("-----get_oss_config")
index.get_oss_config().then((res) => {
this.ossConfig = res.data;
console.log(this.ossConfig,'--ossConfig')
});
},
random_string(len) {
len = len || 32;
let chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
let maxPos = chars.length;
let pwd = "";
for (let i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
}
},
onLoad() {
console.log('------mc---onLoad')
this.get_oss_config();
if (!this.option) {
return console.warn(
"[mpvue-cropper] 请传入option参数\n参数配置见文档:https://we-plugin.github.io/we-cropper/#/api"
);
}
this.init();
},
};
</script>
<style lang="scss" scoped>
.mpvueCropper {
width: 100vw;
height: 100vh;
background: #000;
}
.btn {
position: fixed;
bottom: 0;
padding: 20px 0;
width: 100%;
justify-content: center;
.btn-cont {
width: 90%;
height: 46px;
border: 1px solid #fff;
border-radius: 46px;
align-items: center;
justify-content: space-around;
overflow: hidden;
.cancel {
border-right: 1px solid #fff;
}
& > div {
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #fff;
width: 50%;
height: 46px;
&:active {
background: #229df1;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="popup-wrap">
<van-popup
:show="productDialogStatus"
position="bottom"
:overlay="true"
@close="close"
custom-style="height:399px;border-top-left-radius: 16px;border-top-right-radius: 16px;z-index:100;"
lock-scoll= "true"
>
<div class="product-title" v-if="productList.length">商品列表({{productList.length}})</div>
<div class="product-list" v-if="productList.length">
<div class="item" v-for="(item,index) in productList" :key="index">
<div class="item-index">{{item.number}}</div>
<div class="item-img">
<image :src="item.productImgUrl" mode="aspectFill" alt=""></image>
</div>
<div class="item-detail">
<div class="product-name text-overflow2">
{{item.productName}}
</div>
<div class="product-bottom">
<div class="product-price">{{item.minPrice}}</div>
<div
class="product-do product-up"
@click="setProductStatus(1,item.productId,item)"
v-if="item.upperScreenState == 0 || item.upperScreenState == 2"
>
上屏
</div>
<div
class="product-do product-down"
@click="setProductStatus(0,item.productId,item)"
v-if="item.upperScreenState == 1"
>
下屏
</div>
</div>
</div>
<van-divider customStyle="height:1px;margin:0"></van-divider>
</div>
</div>
<div class="product-no-list" v-else >
暂无商品
</div>
</van-popup>
</div>
</template>
<script>
export default {
props:{
productDialogStatus:{
type:Boolean,
default:false
},
productList:{
type:Array,
default:null
}
},
data(){
return {
list : [],
}
},
watch:{
productList(newVal){
this.productList = newVal
}
},
created(){
},
methods:{
close(){
this.$emit('hideProductPopup',false)
},
setProductStatus(type,id,item,index){
this.$emit('changeProduct',type,id,item)
}
}
}
</script>
<style scoped lang="scss">
.popup-wrap{
position: relative;
z-index: 100;
}
.product-title{
width: 100%;
height: 45px;
line-height: 45px;
font-size: 16px;
color: #333333;
padding-left: 16.5px;
box-sizing: border-box;
}
.product-list{
width: 100%;
height: 350px;
overflow-y: auto;
.item{
display: flex;
justify-content: space-between;
padding: 16px 16.5px;
border-bottom: 1rpx solid #EEEEED;
position: relative;
.item-index{
position: absolute;
width: 19px;
height: 16px;
color: white;
text-align: center;
line-height: 16px;
background-color: #999;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
font-size: 12px;
}
.item-img{
width: 90px;
height: 90px;
border-radius:4px;
background-color: #B1B1B1;
margin-right: 16.5px;
overflow: hidden;
image{
width: 100%;
height: 100%;
object-fit: cover;
}
}
.item-detail{
width: 220.5px;
position: relative;
.product-name{
font-size: 15px;
color: #333333;
}
.product-bottom{
width: 100%;
margin-top: 25px;
position: absolute;
bottom: 0;
left: 0;
.product-price{
font-size: 18px;
color: #FF0000;
float: left;
}
.product-do{
width: 64px;
height: 24px;
text-align: center;
line-height: 24px;
border-radius: 12px;
font-size: 15px;
box-sizing: border-box;
float: right;
}
.product-up{
color: white;
background-image:-webkit-linear-gradient(to right,#FF877D, #FB566D);
background-image:-moz-linear-gradient(to right,#FF877D, #FB566D);
background-image:-o-linear-gradient(to right,#FF877D, #FB566D);
background-image: linear-gradient(to right,#FF877D, #FB566D);
}
.product-down{
color: #FF4240;
border: 1px solid #FF4240;
}
}
}
}
}
.product-no-list{
text-align: center;
padding-top: 40px;
line-height: 18px;
color: #999;
}
</style>
\ No newline at end of file
<template>
<div class="main">
<div class="restaurant-list">
<div class="header_box">
<div class="card_title">餐馆推荐</div>
<div class="see_more">
<span @click="viewMore">查看更多</span>
<i class="iconfont icon-tubiao_jiyao-xiangyou"></i>
</div>
</div>
<div v-if="!isLoading && showList">
<image class="picture" :src="sourceData.restaurantLogo" mode="aspectFill" alt="" />
<div class="title_box">
<div class="title_text">{{ sourceData.restaurantName }}</div>
<div class="title_tag">{{ sourceData.restaurantLabel }}</div>
</div>
<div class="price_box flex">
<div class="count">
<span>承接次数</span>
<span class="price_text">{{ sourceData.receiveCount }}</span>
</div>
<div class="average">
<span>人均</span>
<span class="price_text">{{ sourceData.perCapitaConsumption }}</span>
</div>
</div>
<div class="address">
<div><i class="iconfont icon-dingwei2"></i></div>
<div class="address_text">{{ merchantAddress }}</div>
</div>
<div class="btn_box">
<div class="left_btn" @click="linkMerchant">联系商家</div>
<div class="right_btn" @click="orderNow">立即预订</div>
</div>
</div>
<div class="noList" v-else-if="!isLoading">
<image src="http://cdn.mayi888.com/public/jpg/0aac085c-aa79-4ef2-94c8-7bce73f94943.jpg" mode="widthFix" />
<p class="info">当前城市暂无入驻商家,敬请期待</p>
</div>
</div>
</div>
</template>
<script>
const app = getApp()
import goods from "@/api/goods.js"
import { DFSImg } from "@/utils/index";
export default {
name: "restaurant-list",
props: {
datas: {
type: Object,
default: () => {
return {};
}
}
},
data() {
return {
showList: false,
isLoading: true,
sourceData: {
address: "",
restaurantLabel: "",
restaurantLogo: "",
restaurantName: "",
},
}
},
components: {},
computed: {
merchantAddress() {
const {
provinceName = "",
cityName = "",
areaName = "",
address = ""
} = this.sourceData
return provinceName + cityName + areaName + address
}
},
created() {
this.DFSImg = app.DFSImg;
},
onLoad(options) {
// console.log(options,'商家推荐options')
console.log("当前的地址", wx.getStorageSync('location'));
let _this = this
wx.getLocation({
type: 'wgs84',
success: function (res) {
_this.getList(res);
},
fail: function (err) {
_this.isLoading = false;
_this.showList = true;
console.log('定位失败', err)
wx.showModal({
title: '提示',
content: '定位失败,请检查是否开启了定位服务',
success(res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
_this.getList({
longitude: "",
latitude: ""
});
}
})
}
})
},
methods: {
getList(res) {
let query = {
longitude: res.longitude, // 经度
latitude: res.latitude // 纬度
}
console.log('定位数据', res)
goods.getWlyList(query).then((res) => {
console.log(res,'---res')
this.isLoading = false;
if (res.data.code == 200 && res.data.data) {
this.showList = true;
this.sourceData = res.data.data;
this.sourceData.restaurantLogo = DFSImg(res.data.data.restaurantLogo);
console.log(this.sourceData,DFSImg(res.data.data.restaurantLogo), "商家数据");
} else {
this.showList = false;
}
})
},
viewMore() {
let url = "/pages/wxArticle/main?link=" + encodeURIComponent(process.env.WLY_PROD_MARKETING+"/#/pages/restaurantList/index");
app.$themeToLink({
type: 1.2,
link: url
});
},
linkMerchant() {
wx.makePhoneCall({
phoneNumber: this.sourceData.linkPhone
})
},
orderNow() {
let url = process.env.WLY_PROD_MARKETING + '/#/pages/restaurantInfo/index?restaurantId=' + this.sourceData.id + `${wx.getStorageSync("sessionid") ? `&sessionid=${wx.getStorageSync("sessionid")}` : ''}`
console.log(url, "立即预订的接口地址");
let link = "/pages/wxArticle/main?link=" + encodeURIComponent(url);
app.$themeToLink({
type: 1.2,
link: link
});
},
}
}
</script>
<style lang="scss" scoped>
.main {
overflow: hidden;
box-sizing: border-box !important;
}
.restaurant-list {
// height: 320px;
padding: 12px;
background: #ffffff;
border-radius: 4px;
margin: 10px;
.header_box {
display: flex;
align-items: center;
justify-content: space-between;
}
.noList{
image{
width: 40%;
margin: 20px auto 0;
}
.info{
text-align: center;
color: #999;
font-size: 13px;
margin-bottom: 20px;
}
}
.card_title {
text-align: center;
text-transform: uppercase;
font-size: 18px;
color: #0a0a0a;
font-weight: 600;
}
.see_more {
height: 30px;
color: #999999;
display: flex;
align-items: center;
// margin-bottom: 12px;
.jt {
display: inline-block;
border-top: 1px solid;
border-right: 1px solid;
width: 10px;
height: 10px;
-webkit-transform: rotate(-135deg);
transform: rotate(405deg);
margin-left: 0;
}
}
.picture {
width: 100%;
height: 180px;
margin-top: 12px;
}
.title_box {
display: flex;
// font-weight: 500;
font-size: 18px;
color: #333333;
align-items: center;
margin-top: 12px;
.title_text {
font-weight: 600;
}
.title_tag {
margin-left: 8px;
height: 18px;
font-size: 10px;
line-height: 18px;
border-radius: 2px;
background: #ffe5e7;
color: #e1000f;
text-align: center;
padding: 0 6px;
}
}
.price_box {
margin-top: 6px;
font-size: 12px;
color: #666666;
.count {
margin-right: 12px;
}
.price_text {
margin-left: 6px;
color: #e1000f;
}
}
.address {
margin-top: 12px;
font-size: 14px;
display: flex;
align-items: center;
.address_text {
margin-left: 8px;
}
}
.btn_box {
display: flex;
justify-content: flex-end;
font-size: 16px;
margin-top: 12px;
.left_btn {
padding: 4px 16px;
background: #ffffff;
border-radius: 22px;
color: #e1000f;
border: 1px solid #e1000f;
margin-right: 12px;
}
.right_btn {
padding: 4px 16px;
background: #e1000f;
border-radius: 22px;
color: #ffffff;
border: 1px solid #e1000f;
}
}
}
</style>
......@@ -165,7 +165,6 @@ import bottomCont from "../../components/bottomCont"
import ThemeDataPlant from "../../components/ThemeDataPlant"
import links from '@/components/basicTool/link/index.vue'
import interval from '@/components/basicTool/interval/index.vue'
import restaurantList from '../../components/restaurantList'
import partition from '@/components/basicTool/partition/index.vue'
import shopPopup from '@/components/basicTool/shop-popup/index.vue'
import woTimeout from '@/components/basicTool/wo-timeout/index.vue'
......@@ -193,7 +192,6 @@ import SWQUserSelectTag from "../../components/common/SWQUserSelectTag";
import { setTabBarActive, checkTabbarPage,themeColor, checkShowConditionIds, setStoreInfo, getStoreInfo } from "../../utils/mayi.js";
import indexApi from "@/api/index.js";
import { throttle, concatUrl } from "../../utils/index.js"
import mpvueCropper from '@/components/mpvue-cropper'
import tool from '../../utils/tool.js'
import StoreAddr from "@/components/common/StoreAddr.vue";
import pageLoading from "@/components/common/pageLoading.vue";
......@@ -239,7 +237,6 @@ export default {
};
},
components:{
"restaurant-list":restaurantList,
links,
interval,
partition,
......@@ -258,7 +255,6 @@ export default {
NewUser,
NewPolite,
birthPopup,
mpvueCropper,
woTimeout,
"custom-list": customList,
"rich-text": richText,
......
import posthog from "posthog-js";
console.log("config.POSTHOG_HOST", process.env.POSTHOG_HOST);
posthog.init(process.env.POSTHOG_KEY, {
api_host: process.env.POSTHOG_HOST,
loaded: posthog => {
// 注册全局属性
posthog.register({
env: process.env.ENV_CONFIG,
project: "ant-responsive-shop"
});
console.log(posthog, "---posthog");
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment