## v1.3.1 更新列表
1. 【修复】申请退款后积分等操作可能出现错误的问题 2. 【修复】拼团支付可能出现支付错误的问题 3. 【修复】退款申请后的订单流程优化和积分赠送的问题 4. 【修复】回收站中的商品无法恢复的问题 5. 【修复】一号通短信查询记录不完整的问题 6. 【修复】用户管理批量加分组,标签的问题 7. 【修复】积分日志搜索显示有误的问题 8. 【修复】手动发送优惠券可能会出错的问题 9. 【修复】核销订单创建在某种条件下会出错的问题 10. 【修复】移动端商品详情,购物车等样式兼容问题 11. 【修复】业务流程性的优化
This commit is contained in:
@@ -359,7 +359,6 @@
|
||||
}
|
||||
|
||||
if (this.isLogin) {
|
||||
console.log(that.bargainUid,'that.bargainUid')
|
||||
if(that.bargainUid == 'undefined'){
|
||||
that.bargainUid = that.$store.state.app.uid
|
||||
}
|
||||
|
||||
@@ -314,7 +314,9 @@
|
||||
isState: true, //默认不显示
|
||||
},
|
||||
tagStyle: {
|
||||
img: 'width:100%;'
|
||||
img: 'width:100%;display:block;',
|
||||
table: 'width:100%',
|
||||
video: 'width:100%'
|
||||
},
|
||||
posters: false,
|
||||
weixinStatus: false,
|
||||
@@ -531,53 +533,6 @@
|
||||
});
|
||||
},
|
||||
//#endif
|
||||
// setTime: function() { //到期时间戳
|
||||
// var that = this;
|
||||
// var endTimeList = that.pink;
|
||||
// that.pink.map(item => {
|
||||
// item.time = {
|
||||
// day: '00',
|
||||
// hou: '00',
|
||||
// min: '00',
|
||||
// sec: '00'
|
||||
// };
|
||||
// });
|
||||
// var countDownArr = [];
|
||||
// var timeer = setInterval(function() {
|
||||
// var newTime = new Date().getTime() / 1000;
|
||||
// for (var i in endTimeList) {
|
||||
// var endTime = endTimeList[i].stop_time;
|
||||
// var obj = [];
|
||||
// if (endTime - newTime > 0) {
|
||||
// var time = endTime - newTime;
|
||||
// var day = parseInt(time / (60 * 60 * 24));
|
||||
// var hou = parseInt(time % (60 * 60 * 24) / 3600);
|
||||
// var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
|
||||
// var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
|
||||
// hou = parseInt(hou) + parseInt(day * 24);
|
||||
// obj = {
|
||||
// day: that.timeFormat(day),
|
||||
// hou: that.timeFormat(hou),
|
||||
// min: that.timeFormat(min),
|
||||
// sec: that.timeFormat(sec)
|
||||
// }
|
||||
// } else {
|
||||
// obj = {
|
||||
// day: '00',
|
||||
// hou: '00',
|
||||
// min: '00',
|
||||
// sec: '00'
|
||||
// }
|
||||
// }
|
||||
// endTimeList[i].time = obj;
|
||||
// }
|
||||
// that.pink = endTimeList
|
||||
// }, 1000);
|
||||
// that.timeer = timeer
|
||||
// },
|
||||
// timeFormat(param) { //小于10的格式化函数
|
||||
// return param < 10 ? '0' + param : param;
|
||||
// },
|
||||
/**
|
||||
* 默认选中属性
|
||||
*
|
||||
@@ -936,7 +891,7 @@
|
||||
let storeName = that.storeInfo.title;
|
||||
let price = that.storeInfo.price;
|
||||
setTimeout(() => {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice, function(tempFilePath) {
|
||||
that.posterImage = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
|
||||
@@ -425,13 +425,6 @@ export default {
|
||||
that.isOpen = true;
|
||||
},
|
||||
goPay() {
|
||||
// productId: that.storeInfo.productId,
|
||||
// combinationId:parseFloat(that.id),
|
||||
// cartNum: that.cart_num ? this.cart_num : this.attribute.productSelect.cart_num,
|
||||
// productAttrUnique: productSelect !== undefined ? productSelect.id : '',
|
||||
// isNew: true,
|
||||
|
||||
|
||||
var that = this;
|
||||
var data = {};
|
||||
// that.attr.cartAttr = res;
|
||||
@@ -441,7 +434,6 @@ export default {
|
||||
data.productAttrUnique = that.attr.productSelect.unique;
|
||||
data.combinationId = that.storeCombination.id;
|
||||
data.isNew = true;
|
||||
console.log(that.pinkId);
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -245,7 +245,9 @@
|
||||
lock: false,
|
||||
scrollTop: 0,
|
||||
tagStyle: {
|
||||
img: 'width:100%;'
|
||||
img: 'width:100%;display:block;',
|
||||
table: 'width:100%',
|
||||
video: 'width:100%'
|
||||
},
|
||||
datatime: '',
|
||||
navActive: 0,
|
||||
@@ -581,50 +583,6 @@
|
||||
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
}
|
||||
},
|
||||
// ChangeCartNum: function(changeValue) {
|
||||
// //changeValue:是否 加|减
|
||||
// //获取当前变动属性
|
||||
// let productSelect = this.productValue[this.attrValue];
|
||||
// if (this.cart_num) {
|
||||
// productSelect.cart_num = this.cart_num;
|
||||
// this.attribute.productSelect.cart_num = this.cart_num;
|
||||
// }
|
||||
// //如果没有属性,赋值给商品默认库存
|
||||
// if (productSelect === undefined && !this.attribute.productAttr.length)
|
||||
// productSelect = this.attribute.productSelect;
|
||||
// //无属性值即库存为0;不存在加减;
|
||||
// if (productSelect === undefined) return;
|
||||
// let stock = productSelect.stock || 0;
|
||||
// let num = this.attribute.productSelect;
|
||||
// let quota = productSelect.quota || 0;
|
||||
// //设置默认数据
|
||||
// if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
|
||||
// if (changeValue) {
|
||||
// num.cart_num ++;
|
||||
// if(quota >= stock){
|
||||
// if (num.cart_num > stock) {
|
||||
// this.$set(this.attribute.productSelect, "cart_num", stock);
|
||||
// this.$set(this, "cart_num", stock);
|
||||
// }
|
||||
// }else{
|
||||
// if (num.cart_num > quota) {
|
||||
// this.$set(this.attribute.productSelect, "cart_num", quota);
|
||||
// this.$set(this, "cart_num", quota);
|
||||
// }
|
||||
// }
|
||||
// this.$set(this, "cart_num", num.cart_num);
|
||||
// this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
|
||||
// } else {
|
||||
// num.cart_num--;
|
||||
// if (num.cart_num < 1) {
|
||||
// this.$set(this.attribute.productSelect, "cart_num", 1);
|
||||
// this.$set(this, "cart_num", 1);
|
||||
// }
|
||||
// this.$set(this, "cart_num", num.cart_num);
|
||||
// this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
// }
|
||||
// },
|
||||
attrVal(val) {
|
||||
this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attrValues[val.indexn];
|
||||
},
|
||||
@@ -882,20 +840,13 @@
|
||||
let storeName = that.storeInfo.storeName;
|
||||
let price = that.storeInfo.price;
|
||||
setTimeout(() => {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice,function(tempFilePath) {
|
||||
that.posterImage = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
// let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode];
|
||||
// let storeName = that.storeInfo.storeName;
|
||||
// let price = that.storeInfo.price;
|
||||
// that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
// that.posterImage = tempFilePath;
|
||||
// that.canvasStatus = true;
|
||||
// });
|
||||
},
|
||||
// 小程序二维码
|
||||
getQrcode(){
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
uni.getImageInfo({
|
||||
src: arrImages[0],
|
||||
success: function (image) {
|
||||
console.log('啦啦', image)
|
||||
context.drawImage(arrImages[0], 0, 0, 750, 1190);
|
||||
context.setFontSize(36);
|
||||
context.setTextAlign('center');
|
||||
@@ -210,19 +209,15 @@
|
||||
canvasId: 'firstCanvas',
|
||||
fileType: 'jpg',
|
||||
success: function(res) {
|
||||
console.log('啦啦222', res)
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.hideLoading();
|
||||
//successFn && successFn(res.tempFilePath);
|
||||
that.imagePath = res.tempFilePath;
|
||||
console.log(that.imagePath)
|
||||
that.canvasStatus = true;
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: '无法获取图片信息'
|
||||
|
||||
@@ -179,7 +179,6 @@
|
||||
},
|
||||
setInfo: function(item) {
|
||||
let that = this;
|
||||
console.log(item);
|
||||
setAdminOrderDelivery(item).then(
|
||||
res => {
|
||||
that.$util.Tips({
|
||||
@@ -197,7 +196,6 @@
|
||||
);
|
||||
},
|
||||
bindPickerChange(e){
|
||||
console.log(e,'tar')
|
||||
this.seIndex = e.detail.value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,6 @@
|
||||
that.getIndex();
|
||||
},
|
||||
err => {
|
||||
console.log(err, 'err')
|
||||
that.change = false;
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
@@ -364,13 +363,11 @@
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
webCopy(item, index) {
|
||||
console.log('yunxingle')
|
||||
let items = item
|
||||
let indexs = index
|
||||
let self = this
|
||||
|
||||
if (self.clickNum == 1) {
|
||||
console.log('22')
|
||||
self.clickNum += 1
|
||||
self.webCopy(items, indexs)
|
||||
}
|
||||
|
||||
@@ -228,7 +228,6 @@
|
||||
that.init();
|
||||
},
|
||||
err => {
|
||||
console.log(err,'err')
|
||||
that.change = false;
|
||||
that.$util.Tips({title: err});
|
||||
}
|
||||
|
||||
@@ -25,11 +25,6 @@
|
||||
wechat.auth(code, state)
|
||||
.then(() => {
|
||||
getUserInfo().then(res => {
|
||||
console.log(res);
|
||||
console.log(option.back_url);
|
||||
console.log(decodeURIComponent(
|
||||
decodeURIComponent(option.back_url)
|
||||
));
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
location.href = decodeURIComponent(
|
||||
decodeURIComponent(option.back_url)
|
||||
|
||||
@@ -382,7 +382,6 @@
|
||||
})
|
||||
},
|
||||
onReady: function() {
|
||||
console.log(this.emojiGroup);
|
||||
this.height();
|
||||
this.getHistory();
|
||||
this.getproductInfo();
|
||||
@@ -417,7 +416,6 @@
|
||||
},
|
||||
methods: {
|
||||
uploadImg() {
|
||||
console.log(this.$store.state.app.token)
|
||||
let self = this
|
||||
uni.chooseImage({
|
||||
count: 1, //默认1
|
||||
@@ -460,7 +458,6 @@
|
||||
getOrderInfo() {
|
||||
if (!this.orderId) return;
|
||||
getOrderDetail(this.orderId).then(res => {
|
||||
console.log(res)
|
||||
this.orderInfo = res.data;
|
||||
if (this.orderInfo.add_time_h) {
|
||||
this.orderInfo.add_time_h = this.orderInfo.add_time_h.substring(
|
||||
@@ -511,7 +508,6 @@
|
||||
this.loaded = data.length < this.limit;
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
this.$dialog.error(err || "加载失败");
|
||||
});
|
||||
},
|
||||
@@ -588,7 +584,6 @@
|
||||
if (this.timeOutEvent !== 0 && this.longClick === 0) {
|
||||
//点击
|
||||
//此处为点击事件----在此处添加跳转详情页
|
||||
console.log("这是点击");
|
||||
}
|
||||
this.speak = "按住 说话";
|
||||
this.recording = false;
|
||||
@@ -643,10 +638,9 @@
|
||||
setTimeout(res=>{
|
||||
let info = uni.createSelectorQuery().select(".chat");
|
||||
info.boundingClientRect(function(data) { //data - 各种参数
|
||||
console.log(data.height) // 获取元素宽度
|
||||
// 获取元素宽度
|
||||
scrollTop = data.height
|
||||
}).exec()
|
||||
console.log(scrollTop,'scrollTop')
|
||||
if(this.active){
|
||||
this.scrollTop = scrollTop+500
|
||||
}else{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<view class='list acea-row'>
|
||||
<block v-for="(itemn,indexn) in item.child" :key="indexn">
|
||||
<navigator hover-class='none' :url='"/pages/goods_list/index?cid="+itemn.id+"&title="+itemn.name' class='item acea-row row-column row-middle'>
|
||||
<view class='picture'>
|
||||
<view class='picture' :style="{'background-color':itemn.extra?'none':'#f7f7f7'}">
|
||||
<image :src='itemn.extra'></image>
|
||||
</view>
|
||||
<view class='name line1'>{{itemn.name}}</view>
|
||||
@@ -241,6 +241,9 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
div{
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
}
|
||||
|
||||
.productSort .conter .list .item .name {
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
</view>
|
||||
<view class='introduce'>{{storeInfo.storeName}}</view>
|
||||
<view class='label acea-row row-between-wrapper'>
|
||||
<view>原价:¥{{storeInfo.otPrice}}</view>
|
||||
<view>库存:{{storeInfo.stock}}{{storeInfo.unitName}}</view>
|
||||
<view>销量:{{Number(storeInfo.sales) + Number(storeInfo.ficti) || 0}}{{storeInfo.unitName}}</view>
|
||||
<view>原价:¥{{storeInfo.otPrice || 0}}</view>
|
||||
<view>库存:{{storeInfo.stock || 0}}{{storeInfo.unitName || ''}}</view>
|
||||
<view>销量:{{Math.floor(storeInfo.sales) + Math.floor(storeInfo.ficti) || 0}}{{storeInfo.unitName || ''}}</view>
|
||||
</view>
|
||||
<!-- <view class='coupon acea-row row-between-wrapper' v-if="storeInfo.give_integral > 0">
|
||||
<view class='hide line1 acea-row'>
|
||||
@@ -148,7 +148,7 @@
|
||||
<navigator open-type='switchTab' class="animated item" :class="animated==true?'bounceIn':''" url='/pages/order_addcart/order_addcart'
|
||||
hover-class="none">
|
||||
<view class='iconfont icon-gouwuche1'>
|
||||
<text class='num bg-color'>{{CartCount || 0}}</text>
|
||||
<text v-if="Math.floor(CartCount)>0" class='num bg-color'>{{CartCount}}</text>
|
||||
</view>
|
||||
<view>购物车</view>
|
||||
</navigator>
|
||||
@@ -340,7 +340,9 @@
|
||||
lock: false,
|
||||
scrollTop: 0,
|
||||
tagStyle: {
|
||||
img: 'width:100%;'
|
||||
img: 'width:100%;display:block;',
|
||||
table: 'width:100%',
|
||||
video: 'width:100%'
|
||||
},
|
||||
sliderImage: [],
|
||||
qrcodeSize: 600,
|
||||
@@ -419,7 +421,6 @@
|
||||
// #endif
|
||||
methods: {
|
||||
getChat(uid){
|
||||
console.log(this.uid)
|
||||
window.yzf && window.yzf.init({
|
||||
sign: '37ef9b97872756ce2a1596ec4fe9b66b0b4cbeec7b36239a65924fa6cbd5c29ac6b013c274511b2eee929e72312baeeeb97aae86',
|
||||
token: '', //非必填
|
||||
@@ -786,7 +787,6 @@
|
||||
*/
|
||||
DefaultSelect: function() {
|
||||
let productAttr = this.attr.productAttr;
|
||||
let value = [];
|
||||
let value = [];
|
||||
for (let key in this.productValue) {
|
||||
if (this.productValue[key].stock > 0) {
|
||||
@@ -1040,7 +1040,6 @@
|
||||
}
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
@@ -1116,16 +1115,18 @@
|
||||
getQrcode(data).then(res=>{
|
||||
//that.PromotionCode = res.data.code;
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
that.PromotionCode = res;
|
||||
});
|
||||
});
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
// 生成二维码;
|
||||
make(uid) {
|
||||
let that = this;
|
||||
let href = location.href;
|
||||
href = href.indexOf("?") === -1 ? href + "?spread=" + uid : href + "&spread=" + uid;
|
||||
href = href.indexOf("?") === -1 ? href + "?spread=" + uid : href + "&spread=" + uid;
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
@@ -1180,45 +1181,6 @@
|
||||
},
|
||||
/**
|
||||
* 生成海报
|
||||
*/
|
||||
// goPoster: function() {
|
||||
// debugger
|
||||
// let that = this;
|
||||
// that.posters = false;
|
||||
|
||||
// that.$set(that, 'canvasStatus', true);
|
||||
// let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
|
||||
|
||||
// // // #ifndef H5
|
||||
// if (that.isDown)
|
||||
// return that.$util.Tips({
|
||||
// title: '正在下载海报,请稍后再试!'
|
||||
// });
|
||||
// // // #endif
|
||||
// uni.getImageInfo({
|
||||
// src: that.PromotionCode,
|
||||
// fail: function(res) {
|
||||
// console.log(res)
|
||||
// // #ifdef H5
|
||||
// return that.$util.Tips({
|
||||
// title: res
|
||||
// });
|
||||
// // #endif
|
||||
// // #ifdef MP
|
||||
// return that.$util.Tips({
|
||||
// title: '小程序二维码需要发布正式版后才能获取到'
|
||||
// });
|
||||
// // #endif
|
||||
// },
|
||||
// success(res) {
|
||||
// console.log('成功',res)
|
||||
// //生成推广海报
|
||||
// that.$util.PosterCanvas(arr2, that.storeInfo.storeName, that.storeInfo.price, function(tempFilePath) {
|
||||
// that.imagePath = tempFilePath;
|
||||
// that.canvasStatus = true;
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
*/
|
||||
goPoster: function() {
|
||||
let that = this;
|
||||
@@ -1232,14 +1194,13 @@
|
||||
let arrImages = [that.posterbackgd, arrImagesUrlTop, that.PromotionCode];
|
||||
let storeName = that.storeInfo.storeName;
|
||||
let price = that.storeInfo.price;
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice,function(tempFilePath) {
|
||||
that.imagePath = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/*
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,81 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="canvasStatus">
|
||||
<view class="mask"></view>
|
||||
<image :src='imagePath' class="canvas"></image>
|
||||
</view>
|
||||
<view v-else>
|
||||
<canvas style="width:750rpx;height:1190rpx;position: fixed;z-index: -5;" canvas-id="firstCanvas"></canvas>
|
||||
<canvas style="position:fixed;z-index: -5;opacity: 0;" canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
||||
</view>
|
||||
<div @click='clickgg'>点击</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app.js';
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
imagePath:'',
|
||||
canvasStatus:false,
|
||||
|
||||
qrcodeText: HTTP_REQUEST_URL,
|
||||
qrcodeSize: 129,
|
||||
PromotionCode:''
|
||||
}
|
||||
},
|
||||
onReady: function (e) {
|
||||
this.make();
|
||||
},
|
||||
methods: {
|
||||
// 生成二维码;
|
||||
make() {
|
||||
let that = this;
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
text: this.qrcodeText,
|
||||
size: this.qrcodeSize,
|
||||
margin: 10,
|
||||
success: res => {
|
||||
that.PromotionCode = res;
|
||||
},
|
||||
complete: () => {
|
||||
},
|
||||
fail:res=>{
|
||||
that.$util.Tips({
|
||||
title: '海报二维码生成失败!'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
clickgg(){
|
||||
let that = this;
|
||||
// ../../static/images/barg002.png
|
||||
let arrImages = ['../../static/images/posterbackgd.png','../../static/images/explosion.png',that.PromotionCode];
|
||||
let storeName = '1十大歌手大好时光的电视广上世纪法国设计风格加工费设计规范技术规范设计规范手机话费csdsdsdsd9';
|
||||
let price = '20';
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
console.log('klklkl');
|
||||
that.imagePath = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.canvas{
|
||||
position: fixed;
|
||||
width: 512rpx;
|
||||
height: 864rpx;
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-left: -256rpx;
|
||||
margin-top: -432rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
@@ -282,10 +282,14 @@
|
||||
import {
|
||||
silenceBindingSpread
|
||||
} from '@/utils';
|
||||
|
||||
// #ifdef H5
|
||||
import {
|
||||
kefuConfig
|
||||
} from "@/api/public";
|
||||
import {
|
||||
getWechatConfig
|
||||
} from "@/api/public";
|
||||
// #endif
|
||||
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"];
|
||||
export default {
|
||||
computed: mapGetters(['isLogin', 'uid']),
|
||||
@@ -434,7 +438,6 @@
|
||||
let arr = res.data.map((item) => {
|
||||
return item.tempId
|
||||
})
|
||||
//console.log(arr)
|
||||
wx.setStorageSync('tempID'+ data, arr);
|
||||
}
|
||||
})
|
||||
@@ -627,11 +630,17 @@
|
||||
})
|
||||
},
|
||||
getChatUrL() {
|
||||
kefuConfig().then(res => {
|
||||
let data = res.data;
|
||||
this.$store.commit("SET_CHATURL", data.yzfUrl);
|
||||
Cache.set('chatUrl', data.yzfUrl);
|
||||
})
|
||||
},
|
||||
getMpChatUrL(){
|
||||
getWechatConfig().then(res => {
|
||||
let data = res.data;
|
||||
this.$store.commit("SET_CHATURL", data.yzfUrl);
|
||||
Cache.set('chatUrl', data.yzfUrl);
|
||||
console.log(data)
|
||||
})
|
||||
},
|
||||
// setOpenShare:function(mss){
|
||||
@@ -772,7 +781,7 @@
|
||||
mounted() {
|
||||
let self = this
|
||||
// #ifdef H5
|
||||
this.getChatUrL();
|
||||
self.$wechat.isWeixin()?self.getMpChatUrL():self.getChatUrL();
|
||||
// 获取H5 搜索框高度
|
||||
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
|
||||
appSearchH.boundingClientRect(function(data) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<view class='list acea-row row-middle'>
|
||||
<view class='label'>{{articleInfo.categoryName}}</view>
|
||||
<view class='item'></text>{{articleInfo.createTime}}</view>
|
||||
<!-- <view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view> -->
|
||||
<view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view>
|
||||
</view>
|
||||
<view class='conters'>
|
||||
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
|
||||
@@ -140,7 +140,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@
|
||||
let selectValueProductId = that.getSelectValueProductId();
|
||||
collectAll(that.getSelectValueProductId()).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: res,
|
||||
title: '收藏成功',
|
||||
icon: 'success'
|
||||
});
|
||||
}).catch(err => {
|
||||
|
||||
@@ -344,11 +344,9 @@
|
||||
this.switchSelect();
|
||||
},
|
||||
blurInput:function (index) {
|
||||
console.log(66);
|
||||
let item = this.cartList.valid[index];
|
||||
if(!item.cart_num){
|
||||
item.cart_num = 1;
|
||||
console.log( item.cart_num)
|
||||
this.$set(this.cartList,'valid',this.cartList.valid)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -444,7 +444,6 @@
|
||||
subDel: function(event) {
|
||||
let that = this,
|
||||
selectValue = that.selectValue;
|
||||
console.log(that.selectValue)
|
||||
|
||||
// if (selectValue.length > 0)
|
||||
// cartDel(selectValue).then(res => {
|
||||
@@ -478,8 +477,6 @@
|
||||
selectValue = that.selectValue;
|
||||
if (selectValue.length > 0) {
|
||||
let selectValueProductId = that.getSelectValueProductId();
|
||||
console.log('selectValueProductId');
|
||||
console.log(selectValueProductId.join(','));
|
||||
// collectAll(that.getSelectValueProductId()).then(res => {
|
||||
// return that.$util.Tips({
|
||||
// title: res.msg,
|
||||
@@ -499,7 +496,6 @@
|
||||
subOrder: function(event) {
|
||||
let that = this,
|
||||
selectValue = that.selectValue;
|
||||
console.log(that.selectValue)
|
||||
if (selectValue.length > 0) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/users/order_confirm/index?new=false&cartId=' + selectValue.join(',')
|
||||
@@ -541,13 +537,10 @@
|
||||
}
|
||||
that.$set(that.cartList, 'valid', valid);
|
||||
that.selectValue = selectValue;
|
||||
console.log('cartList', that.cartList)
|
||||
console.log(that.selectValue)
|
||||
that.switchSelect();
|
||||
}
|
||||
},
|
||||
checkboxChange: function(event) {
|
||||
console.log(event)
|
||||
let that = this;
|
||||
let value = event.detail.value;
|
||||
let valid = that.cartList.valid;
|
||||
@@ -587,8 +580,6 @@
|
||||
let newArr = that.cartList.valid.filter(item => item.attrStatus);
|
||||
that.isAllSelect = value.length == newArr.length;
|
||||
that.selectValue = value
|
||||
console.log('选中', that.selectValue)
|
||||
console.log('啦啦啦', that.cartList.valid)
|
||||
that.switchSelect();
|
||||
},
|
||||
inArray: function(search, array) {
|
||||
@@ -703,7 +694,6 @@
|
||||
let valid = res.data.list;
|
||||
let loadend = valid.length < that.limit;
|
||||
let validList = that.$util.SplitArray(valid, that.cartList.valid)
|
||||
console.log(validList)
|
||||
//console.log(that.$util.toStringValue(validList))
|
||||
|
||||
let numSub = [{
|
||||
|
||||
@@ -657,14 +657,19 @@
|
||||
totalPrice: '0',
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
id: 0,//订单id
|
||||
uniId:''
|
||||
id: 0, //订单id
|
||||
uniId: ''
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'chatUrl']),
|
||||
onLoad: function(options) {
|
||||
if (!options.order_id && !options.uniId) return this.$util.Tips({title:'缺少参数'},{tab:3,url:1});
|
||||
this.$set(this, 'order_id', options.order_id);
|
||||
if (!options.order_id && !options.uniId) return this.$util.Tips({
|
||||
title: '缺少参数'
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
this.$set(this, 'order_id', options.order_id);
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
@@ -696,8 +701,8 @@
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
kefuClick(){
|
||||
location.href = this.chatUrl;
|
||||
kefuClick() {
|
||||
location.href = this.chatUrl;
|
||||
},
|
||||
goGoodCall() {
|
||||
let self = this
|
||||
@@ -824,8 +829,9 @@
|
||||
that.$set(that, 'evaluate', _type == 3 ? 3 : 0);
|
||||
that.$set(that, 'system_store', res.data.systemStore);
|
||||
that.$set(that, 'id', res.data.id);
|
||||
let cartInfo = res.data.cartInfo,newCartInfo = [];
|
||||
cartInfo.forEach((item,index)=>{
|
||||
let cartInfo = res.data.cartInfo,
|
||||
newCartInfo = [];
|
||||
cartInfo.forEach((item, index) => {
|
||||
newCartInfo.push(item.info);
|
||||
});
|
||||
that.$set(that, 'cartInfo', newCartInfo);
|
||||
@@ -847,7 +853,11 @@
|
||||
* 生成二维码
|
||||
*/
|
||||
markCode(text) {
|
||||
qrcodeApi({ height: '145', text: text, width: '145' }).then(res => {
|
||||
qrcodeApi({
|
||||
height: '145',
|
||||
text: text,
|
||||
width: '145'
|
||||
}).then(res => {
|
||||
this.codeImg = res.data.code
|
||||
});
|
||||
},
|
||||
@@ -859,7 +869,7 @@
|
||||
copy: function() {
|
||||
let that = this;
|
||||
uni.setClipboardData({
|
||||
data: this.orderInfo.order_id
|
||||
data: this.orderInfo.orderId
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
@@ -912,11 +922,15 @@
|
||||
*/
|
||||
goOrderConfirm: function() {
|
||||
let that = this;
|
||||
orderAgain(that.orderInfo.unique).then(res => {
|
||||
orderAgain(that.orderInfo.orderId).then(res => {
|
||||
return uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + res.data.cateId + '&again=true&new=true&addAgain=true'
|
||||
});
|
||||
});
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
confirmOrder: function() {
|
||||
let that = this;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class='payment-status'>
|
||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
||||
<view class='iconfont icons icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
|
||||
<view class='iconfont icons icon-iconfontguanbi bg-color' v-else></view>
|
||||
<view class='iconfont icons icon-iconfontguanbi' v-else></view>
|
||||
<!-- 失败时:订单支付失败 -->
|
||||
<view class='status' v-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '订单支付成功':'订单支付失败'}}</view>
|
||||
<view class='status' v-else>订单创建成功</view>
|
||||
@@ -14,7 +14,7 @@
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>下单时间</view>
|
||||
<view class='itemCom'>{{order_pay_info.createTime}}</view>
|
||||
<view class='itemCom'>{{order_pay_info.createTime?order_pay_info.createTime:'-'}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>支付方式</view>
|
||||
@@ -34,7 +34,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!--失败时: 重新购买 -->
|
||||
<view @tap="goOrderDetails" v-if="status==0">
|
||||
<view @tap="goOrderDetails">
|
||||
<button formType="submit" class='returnBnt bg-color' hover-class='none'>查看订单</button>
|
||||
</view>
|
||||
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
|
||||
@@ -179,6 +179,10 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.icon-iconfontguanbi{
|
||||
background-color: #999 !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
.payment-status {
|
||||
background-color: #fff;
|
||||
margin: 195rpx 30rpx 0 30rpx;
|
||||
|
||||
@@ -115,9 +115,7 @@
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<!-- <view style="height: 50rpx;"></view> -->
|
||||
<img src="/static/images/support.png" alt="" class='support'>
|
||||
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
@@ -347,7 +345,6 @@
|
||||
margin: 54rpx auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.new-users {
|
||||
.head {
|
||||
padding-top: 30rpx;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<view class="CommissionRank">
|
||||
<view class="header">
|
||||
<view class="rank" v-if="position&&position<100 ">您目前的排名<text class="num">{{position}}</text>名</view>
|
||||
<view class="rank" v-if="position">您目前的排名<text class="num">{{position}}</text>名</view>
|
||||
<view class="rank" v-else>您目前暂无排名</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
@@ -63,7 +63,7 @@
|
||||
active: 0,
|
||||
rankList: [],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
limit: 20,
|
||||
loadend: false,
|
||||
loading: false,
|
||||
loadTitle: '加载更多',
|
||||
@@ -104,7 +104,7 @@
|
||||
this.loadend = false;
|
||||
this.$set(this, 'rankList', []);
|
||||
this.getBrokerageRankList();
|
||||
this.getBrokerageRankNumber();
|
||||
this.getBrokerageRankNumber(this.type);
|
||||
},
|
||||
getBrokerageRankNumber(type) {
|
||||
brokerageRankNumber({
|
||||
@@ -124,23 +124,16 @@
|
||||
type: this.type
|
||||
}).then(res => {
|
||||
let list = res.data;
|
||||
let loadend = list.length < this.limit;
|
||||
this.rankList = this.$util.SplitArray(list, this.rankList);
|
||||
this.$set(that,'rankList',this.rankList);
|
||||
this.loadend = loadend;
|
||||
let loadend = list.length <= this.limit;
|
||||
this.rankList.push.apply(this.rankList, list);
|
||||
this.loading = false;
|
||||
this.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
|
||||
// let list = res.data;
|
||||
// let loadend = list.length < this.limit;
|
||||
// this.rankList.push.apply(this.rankList, list);
|
||||
// this.loading = false;
|
||||
// this.loadend = loadend;
|
||||
// this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多';
|
||||
// this.$set(this, 'rankList', this.rankList);
|
||||
// this.position = res.data.position;
|
||||
this.loadend = loadend;
|
||||
this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多';
|
||||
this.$set(this, 'rankList', this.rankList);
|
||||
//this.position = res.data.position;
|
||||
}).catch(err => {
|
||||
this.loading = false;
|
||||
this.loadTitle = '加载更多';
|
||||
this.loadTitle = '加载更多';
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -185,13 +185,11 @@
|
||||
});
|
||||
value.productScore = product_score;
|
||||
value.serviceScore = service_score;
|
||||
console.log("that.pics");
|
||||
let aa = JSON.stringify(that.pics);
|
||||
console.log(typeof aa);
|
||||
value.pics = JSON.stringify(that.pics);
|
||||
value.pics = that.pics.length>0?JSON.stringify(that.pics):'';
|
||||
value.productId = that.productId;
|
||||
value.oid = that.evaluateId;
|
||||
value.unique = that.unique;
|
||||
value.sku = that.productInfo.attrInfo.suk;
|
||||
uni.showLoading({
|
||||
title: "正在发布评论……"
|
||||
});
|
||||
|
||||
@@ -11,8 +11,16 @@
|
||||
</div>
|
||||
<div class="row-right">
|
||||
<div>
|
||||
<!-- #ifdef H5 -->
|
||||
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<view class="store-phone" @click="call(item.phone)"><text class="iconfont icon-dadianhua01"></text></view>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
<!-- <div>
|
||||
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
||||
</div> -->
|
||||
<div class="store-distance" @click.stop="showMaoLocation(item)">
|
||||
<span class="addressTxt" v-if="item.range">距离{{ item.range }}千米</span>
|
||||
<span class="addressTxt" v-else>查看地图</span>
|
||||
@@ -89,12 +97,18 @@
|
||||
this.getList();
|
||||
} else {
|
||||
this.selfLocation();
|
||||
this.getList();
|
||||
}
|
||||
// this.$scroll(this.$refs.container, () => {
|
||||
// !this.loading && this.getList();
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
call(phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone,
|
||||
});
|
||||
},
|
||||
selfLocation() {
|
||||
let self = this
|
||||
uni.getLocation({
|
||||
|
||||
@@ -141,7 +141,6 @@
|
||||
DelPic:function(e){
|
||||
let index = e, that = this;
|
||||
that.refund_reason_wap_imgPath.splice(index, 1);
|
||||
// that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
||||
},
|
||||
/**
|
||||
* 上传文件
|
||||
@@ -150,10 +149,7 @@
|
||||
uploadpic:function(){
|
||||
let that=this;
|
||||
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
|
||||
// that.refund_reason_wap_img.push(res.data.url);
|
||||
that.refund_reason_wap_imgPath.push(res.data.url);
|
||||
// that.$set(that,'refund_reason_wap_img',that.refund_reason_wap_img);
|
||||
// that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -161,11 +157,9 @@
|
||||
* 申请退货
|
||||
*/
|
||||
subRefund:function(e){
|
||||
|
||||
let that = this, value = e.detail.value;
|
||||
console.log(that.refund_reason_wap_imgPath.join(','));
|
||||
//收集form表单
|
||||
if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
|
||||
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
|
||||
orderRefundVerify({
|
||||
text: that.RefundArray[that.index] || '',
|
||||
refund_reason_wap_explain: value.refund_reason_wap_explain,
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
||||
// that.isShowCode = true;
|
||||
// }
|
||||
that.$util.Tips({title:res.message});
|
||||
that.$util.Tips({title:res});
|
||||
});
|
||||
},
|
||||
navTap: function(index) {
|
||||
@@ -347,7 +347,11 @@
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
})
|
||||
}).catch(e => {
|
||||
that.$util.Tips({
|
||||
title: e
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
that.$util.Tips({
|
||||
|
||||
@@ -153,7 +153,9 @@
|
||||
getCouponsOrderPrice,
|
||||
orderCreate,
|
||||
postOrderComputed,
|
||||
orderPay
|
||||
orderPay,
|
||||
wechatOrderPay,
|
||||
wechatQueryPayResult
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
getAddressDefault,
|
||||
@@ -211,11 +213,11 @@
|
||||
payStatus: 1,
|
||||
},
|
||||
{
|
||||
"name": "线下支付",//offlinePayStatu:1开启线下支付;2关闭;offlinePostage:true有邮费
|
||||
"name": "线下支付", //offlinePayStatu:1开启线下支付;2关闭;offlinePostage:true有邮费
|
||||
"icon": "icon-yinhangqia",
|
||||
value: 'offline',
|
||||
title: '线下支付',
|
||||
payStatus: 2,
|
||||
payStatus: 1,
|
||||
},
|
||||
],
|
||||
payType: 'weixin', //支付方式
|
||||
@@ -268,7 +270,7 @@
|
||||
offlinePostage: "",
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
from: '',
|
||||
payChannel: '',
|
||||
news: true,
|
||||
again: false,
|
||||
addAgain: false,
|
||||
@@ -280,10 +282,10 @@
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad: function(options) {
|
||||
// #ifdef H5
|
||||
this.from = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
||||
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.from = 'routine'
|
||||
this.payChannel = 'routine'
|
||||
// #endif
|
||||
if (!options.cartId) return this.$util.Tips({
|
||||
title: '请选择要购买的商品'
|
||||
@@ -306,9 +308,7 @@
|
||||
this.getaddressInfo();
|
||||
this.getConfirm();
|
||||
//调用子页面方法授权后执行获取地址列表
|
||||
this.$nextTick(function() {
|
||||
this.$refs.addressWindow.getAddressList();
|
||||
})
|
||||
this.$nextTick(function() {})
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
@@ -412,7 +412,6 @@
|
||||
shippingType: parseInt(shippingType) + 1,
|
||||
payType: this.payType
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
let result = res.data.result.result;
|
||||
if (result) {
|
||||
this.totalPrice = result.orderId.payPrice;
|
||||
@@ -511,7 +510,7 @@
|
||||
*/
|
||||
getConfirm: function() {
|
||||
let that = this;
|
||||
orderConfirm(that.cartId,that.news,this.addAgain,this.secKill,this.combination,this.bargain).then(res => {
|
||||
orderConfirm(that.cartId, that.news, this.addAgain, this.secKill, this.combination, this.bargain).then(res => {
|
||||
that.$set(that, 'userInfo', res.data.userInfo);
|
||||
that.$set(that, 'integral', res.data.userInfo.integral);
|
||||
that.$set(that, 'cartInfo', res.data.cartInfo);
|
||||
@@ -523,11 +522,11 @@
|
||||
that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice), parseFloat(res.data
|
||||
.priceGroup.storePostage)));
|
||||
that.$set(that, 'seckillId', parseInt(res.data.secKillId));
|
||||
that.$set(that, 'store_self_mention', res.data.storeSelfMention == 'true'?true:false);
|
||||
that.$set(that, 'store_self_mention', res.data.storeSelfMention == 'true' ? true : false);
|
||||
that.cartArr[1].title = '可用余额:' + res.data.userInfo.nowMoney;
|
||||
that.cartArr[0].payStatus = res.data.payWeixinOpen || 0
|
||||
that.cartArr[1].payStatus = res.data.yuePayStatus || 0
|
||||
if (res.data.offlinePayStatus == 2) {
|
||||
if (res.data.offlinePayStatus == 1) {
|
||||
that.cartArr[2].payStatus = 1
|
||||
} else {
|
||||
that.cartArr[2].payStatus = 0
|
||||
@@ -536,7 +535,7 @@
|
||||
// that.$set(that, 'cartArr', that.cartArr);
|
||||
that.$set(that, 'ChangePrice', that.totalPrice);
|
||||
that.getBargainId();
|
||||
if(!that.secKill) that.getCouponList();
|
||||
if (!that.secKill) that.getCouponList();
|
||||
}).catch(err => {
|
||||
return this.$util.Tips({
|
||||
title: err
|
||||
@@ -555,8 +554,8 @@
|
||||
let BargainId = 0;
|
||||
let combinationId = 0;
|
||||
cartINfo.forEach(function(value, index, cartINfo) {
|
||||
BargainId = cartINfo[index].bargainId,
|
||||
combinationId = cartINfo[index].combinationId
|
||||
BargainId = cartINfo[index].bargainId || 0,
|
||||
combinationId = cartINfo[index].combinationId || 0
|
||||
})
|
||||
that.$set(that, 'BargainId', parseInt(BargainId));
|
||||
that.$set(that, 'combinationId', parseInt(combinationId));
|
||||
@@ -586,7 +585,7 @@
|
||||
let that = this;
|
||||
if (that.addressId) {
|
||||
getAddressDetail(that.addressId).then(res => {
|
||||
if(res.data){
|
||||
if (res.data) {
|
||||
res.data.isDefault = parseInt(res.data.isDefault);
|
||||
that.addressInfo = res.data || {};
|
||||
that.addressId = res.data.id || 0;
|
||||
@@ -595,7 +594,7 @@
|
||||
})
|
||||
} else {
|
||||
getAddressDefault().then(res => {
|
||||
if(res.data){
|
||||
if (res.data) {
|
||||
res.data.isDefault = parseInt(res.data.isDefault);
|
||||
that.addressInfo = res.data || {};
|
||||
that.addressId = res.data.id || 0;
|
||||
@@ -627,7 +626,8 @@
|
||||
that.textareaStatus = false;
|
||||
that.address.address = true;
|
||||
that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
|
||||
'&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain;
|
||||
'&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' +
|
||||
this.bargain;
|
||||
},
|
||||
realName: function(e) {
|
||||
this.contacts = e.detail.value;
|
||||
@@ -638,36 +638,176 @@
|
||||
payment: function(data) {
|
||||
let that = this;
|
||||
orderCreate(that.orderKey, data).then(res => {
|
||||
let result = res.data.result,
|
||||
status = res.data.status,
|
||||
orderId = result.orderId,
|
||||
jsConfig = res.data.jsConfig,
|
||||
message = res.data.message;
|
||||
if(that.totalPrice===0)return that.$util.Tips({
|
||||
that.getOrderPay(res.data.orderNo, '支付成功');
|
||||
// if(that.totalPrice===0)return that.$util.Tips({
|
||||
// title: '支付成功',
|
||||
// icon: 'success'
|
||||
// });
|
||||
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
// orderCreate(that.orderKey, data).then(res => {
|
||||
// let result = res.data.result,
|
||||
// status = res.data.status,
|
||||
// orderId = result.orderId,
|
||||
// jsConfig = res.data.jsConfig,
|
||||
// message = res.data.message;
|
||||
// if(that.totalPrice===0)return that.$util.Tips({
|
||||
// title: '支付成功',
|
||||
// icon: 'success'
|
||||
// });
|
||||
// if(that.news == "false"){
|
||||
// orderPay({
|
||||
// 'paytype': that.payType,
|
||||
// 'uni':res.data.result.key,
|
||||
// // #ifdef MP
|
||||
// 'from': 'routine',
|
||||
// // #endif
|
||||
// // #ifdef H5 || APP-PLUS
|
||||
// 'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||
// // #endif
|
||||
// }).then(res=>{
|
||||
// result = res.data.result;
|
||||
// status = res.data.status;
|
||||
// orderId = result.orderId;
|
||||
// jsConfig = res.data.jsConfig;
|
||||
// message = res.data.message;
|
||||
// that.getPayType(status,orderId,message,jsConfig);
|
||||
// })
|
||||
// }else{
|
||||
// that.getPayType(status,orderId,message,jsConfig);
|
||||
// }
|
||||
// }).catch(err => {
|
||||
// uni.hideLoading();
|
||||
// return that.$util.Tips({
|
||||
// title: err
|
||||
// });
|
||||
// });
|
||||
},
|
||||
getOrderPay: function(orderNo, message) {
|
||||
let that = this;
|
||||
let goPages = '/pages/order_pay_status/index?order_id=' + orderNo + '&msg=' + message;
|
||||
wechatOrderPay({
|
||||
orderNo: orderNo,
|
||||
// #ifdef MP
|
||||
payChannel: 'routine',
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
payChannel: that.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||
// #endif
|
||||
payType: that.payType
|
||||
}).then(res => {
|
||||
let jsConfig = res.data.jsConfig;
|
||||
switch (res.data.payType) {
|
||||
case 'weixin':
|
||||
// #ifdef MP
|
||||
uni.requestPayment({
|
||||
timeStamp: jsConfig.timeStamp,
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: jsConfig.packages,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign,
|
||||
success: function(ress) {
|
||||
uni.hideLoading();
|
||||
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 4,
|
||||
url: goPages
|
||||
});
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages
|
||||
});
|
||||
if(that.news == "false"){
|
||||
orderPay({
|
||||
'paytype': that.payType,
|
||||
'uni':res.data.result.key,
|
||||
// #ifdef MP
|
||||
'from': 'routine',
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||
// #endif
|
||||
}).then(res=>{
|
||||
result = res.data.result;
|
||||
status = res.data.status;
|
||||
orderId = result.orderId;
|
||||
jsConfig = res.data.jsConfig;
|
||||
message = res.data.message;
|
||||
that.getPayType(status,orderId,message,jsConfig);
|
||||
},
|
||||
fail: function(e) {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
},
|
||||
complete: function(e) {
|
||||
uni.hideLoading();
|
||||
//关闭当前页面跳转至订单状态
|
||||
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
},
|
||||
})
|
||||
}else{
|
||||
that.getPayType(status,orderId,message,jsConfig);
|
||||
}
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let data = {
|
||||
timestamp: jsConfig.timeStamp,
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: jsConfig.packages,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign
|
||||
};
|
||||
that.$wechat.pay(data).then(res => {
|
||||
if (res.errMsg == 'chooseWXPay:cancel') {
|
||||
return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
} else {
|
||||
wechatQueryPayResult({
|
||||
orderNo: orderNo
|
||||
}).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages
|
||||
});
|
||||
}).cache(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
break;
|
||||
case 'yue':
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: message
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=1'
|
||||
});
|
||||
break;
|
||||
case 'weixinh5':
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: '订单创建成功'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=0'
|
||||
});
|
||||
setTimeout(() => {
|
||||
location.href = jsConfig.mwebUrl;
|
||||
}, 100)
|
||||
break;
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
@@ -675,7 +815,7 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
getPayType: function(status,orderId,message,jsConfig){
|
||||
getPayType: function(status, orderId, message, jsConfig) {
|
||||
let that = this;
|
||||
let goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + message;
|
||||
switch (status) {
|
||||
@@ -690,7 +830,7 @@
|
||||
url: goPages
|
||||
});
|
||||
break;
|
||||
case 'SUCCESS':
|
||||
case 'SUCCESS':
|
||||
uni.hideLoading();
|
||||
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
|
||||
return that.$util.Tips({
|
||||
@@ -699,7 +839,7 @@
|
||||
}, {
|
||||
tab: 4,
|
||||
url: goPages
|
||||
});
|
||||
});
|
||||
return that.$util.Tips({
|
||||
title: message,
|
||||
icon: 'success'
|
||||
@@ -761,12 +901,12 @@
|
||||
let jsConfigAgain = jsConfig;
|
||||
let packages = 'prepay_id=' + jsConfigAgain.prepayId;
|
||||
let data = {
|
||||
timestamp:jsConfigAgain.timeStamp,
|
||||
nonceStr:jsConfigAgain.nonceStr,
|
||||
package:packages,
|
||||
signType:jsConfigAgain.signType,
|
||||
paySign:jsConfigAgain.paySign,
|
||||
h5PayUrl:jsConfigAgain.h5PayUrl
|
||||
timestamp: jsConfigAgain.timeStamp,
|
||||
nonceStr: jsConfigAgain.nonceStr,
|
||||
package: packages,
|
||||
signType: jsConfigAgain.signType,
|
||||
paySign: jsConfigAgain.paySign,
|
||||
h5PayUrl: jsConfigAgain.h5PayUrl
|
||||
};
|
||||
this.$wechat.pay(data).then(res => {
|
||||
return that.$util.Tips({
|
||||
@@ -788,7 +928,6 @@
|
||||
break;
|
||||
case 'PAY_DEFICIENCY':
|
||||
uni.hideLoading();
|
||||
//余额不足
|
||||
return that.$util.Tips({
|
||||
title: message
|
||||
}, {
|
||||
@@ -799,7 +938,7 @@
|
||||
case "WECHAT_H5_PAY": //网页版公众号支付
|
||||
setTimeout(() => {
|
||||
let domain = encodeURIComponent(location.href);
|
||||
let urls = jsConfigAgain.h5PayUrl + '&redirect_url='+ domain;
|
||||
let urls = jsConfigAgain.h5PayUrl + '&redirect_url=' + domain;
|
||||
location.href = urls;
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
@@ -812,7 +951,7 @@
|
||||
break;
|
||||
}
|
||||
},
|
||||
SubOrder: function(e) {
|
||||
SubOrder: function(e) {
|
||||
|
||||
let that = this,
|
||||
data = {};
|
||||
@@ -857,24 +996,27 @@
|
||||
seckillId: that.seckillId,
|
||||
mark: that.mark,
|
||||
storeId: that.system_store.id || 0,
|
||||
'from': that.from,
|
||||
shippingType: that.$util.$h.Add(that.shippingType, 1),
|
||||
isNew: that.news
|
||||
isNew: that.news,
|
||||
payChannel: that.payChannel
|
||||
|
||||
};
|
||||
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice)) return that.$util.Tips({
|
||||
title: '余额不足!'
|
||||
});
|
||||
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice)) return that.$util
|
||||
.Tips({
|
||||
title: '余额不足!'
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '订单支付中'
|
||||
});
|
||||
// #ifdef MP
|
||||
openPaySubscribe().then(() => {
|
||||
that.payment(data);
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
// // #ifdef MP
|
||||
// openPaySubscribe().then(() => {
|
||||
// that.payment(data);
|
||||
// });
|
||||
// // #endif
|
||||
// // #ifndef MP
|
||||
// that.payment(data);
|
||||
// // #endif
|
||||
that.payment(data);
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@
|
||||
this.isShowAuth = e
|
||||
},
|
||||
setSort: function(sortKey,isAsc) {
|
||||
console.log(sortKey);
|
||||
let that = this;
|
||||
that.isAsc = isAsc;
|
||||
that.sort = sortKey+isAsc;
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
again() {
|
||||
this.codeUrl =
|
||||
VUE_APP_API_URL + "/captcha?" + this.keyCode + Date.parse(new Date());
|
||||
console.log(this.codeUrl);
|
||||
},
|
||||
getCode() {
|
||||
getCodeApi()
|
||||
@@ -142,7 +141,6 @@
|
||||
that.sendCode();
|
||||
})
|
||||
.catch(res => {
|
||||
console.log(res, 'res')
|
||||
// if (res.data.status === 402) {
|
||||
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
||||
// that.isShowCode = true;
|
||||
|
||||
@@ -2,22 +2,20 @@
|
||||
<view>
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index">
|
||||
<view class='money' :class='item.isValid === false ? "moneyGray" : ""'>
|
||||
<view class='money' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'moneyGray' : ''">
|
||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view class="pic-num">满{{ item.minPrice }}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line1'>
|
||||
<view class="line-title" :class="item.isValid === false ? 'bg-color-huic' : 'bg-color-check'" v-if="item.useType === 1">通用劵</view>
|
||||
<view class="line-title" :class="item.isValid === false ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 2">商品券</view>
|
||||
<view class="line-title" :class="item.isValid === false ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 3">品类券</view>
|
||||
|
||||
<view>{{item.name}}</view>
|
||||
<view class='condition line2'>
|
||||
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-if="item.useType === 1">通用</span>
|
||||
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 2">商品</span>
|
||||
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 3">品类</span>
|
||||
<span>{{item.name}}</span>
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
<view>{{item.startTime}} ~ {{item.endTime}}</view>
|
||||
<view class='bnt gray' v-if="item.isValid===false">已过期</view>
|
||||
<view class='bnt bg-color' v-else>可使用</view>
|
||||
<view>{{item.useStartTimeStr}}~{{item.useEndTimeStr}}</view>
|
||||
<view class='bnt' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart'?'gray':'bg-color'">{{item.validStr | validStrFilter}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -55,6 +53,17 @@
|
||||
// #endif
|
||||
home
|
||||
},
|
||||
filters: {
|
||||
validStrFilter(status) {
|
||||
const statusMap = {
|
||||
'usable': '可用',
|
||||
'unusable': '已用',
|
||||
'overdue': '过期',
|
||||
'notStart': '未开始'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
couponsList: [],
|
||||
@@ -111,24 +120,27 @@
|
||||
|
||||
.pic-num {
|
||||
color: #ffffff;
|
||||
font-size: 0.24rem;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.coupon-list .item .text{
|
||||
height: 100%;
|
||||
}
|
||||
.coupon-list .item .text .condition{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* display: flex;
|
||||
align-items: center; */
|
||||
}
|
||||
.condition .line-title {
|
||||
/* width: 90rpx; */
|
||||
width: 90rpx;
|
||||
height: 40rpx !important;
|
||||
line-height: 40rpx !important;
|
||||
padding: 0 10rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 247, 247, 1);
|
||||
border: 1px solid rgba(232, 51, 35, 1);
|
||||
opacity: 1;
|
||||
border-radius: 22rpx;
|
||||
font-size: 20rpx !important;
|
||||
border-radius: 20rpx;
|
||||
font-size: 18rpx !important;
|
||||
color: #e83323;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line1'>
|
||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-if='item.type===0'>通用劵</span>
|
||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else-if='item.type===1'>品类券</span>
|
||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else>商品券</span>
|
||||
<view class='condition line2'>
|
||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-if='item.useType===1'>通用</span>
|
||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else-if='item.useType===3'>品类</span>
|
||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else>商品</span>
|
||||
<span>{{item.name}}</span>
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
<view>{{ item.receiveStartTime ? item.receiveStartTime + "-" : ""}}{{ item.receiveEndTime }}</view>
|
||||
<view v-if="item.day>0">领取后{{item.day}}天内可用</view>
|
||||
<view v-else>{{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}}</view>
|
||||
<view class='bnt gray' v-if="item.isUse==true">已领取</view>
|
||||
<view class='bnt bg-color' v-else @click='getCoupon(item.id,index)'>立即领取</view>
|
||||
</view>
|
||||
|
||||
@@ -1,475 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<form @submit="formSubmit" report-submit='true'>
|
||||
<view class='personal-data'>
|
||||
<!-- <view class="wrapper">
|
||||
<view class="title">管理我的账号</view>
|
||||
<view class="wrapList">
|
||||
<view class="item acea-row row-between-wrapper" :class="item.uid === userInfo.uid ? 'on' : ''" v-for="(item,index) in switchUserInfo"
|
||||
:key="index" @click='switchAccounts(index)'>
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue" @click.stop='uploadpic' v-if='item.uid === userInfo.uid'>
|
||||
<image :src='item.avatar'></image>
|
||||
<image src='../../../static/images/alter.png' class="alter"></image>
|
||||
</view>
|
||||
<view class="pictrue" v-else>
|
||||
<image :src='item.avatar'></image>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1">{{ item.nickname }}</view>
|
||||
<view class="phone" v-if="item.phone && item.user_type !='h5'">绑定手机号:{{ item.phone }}</view>
|
||||
<view class="phone" v-else-if="item.phone && item.user_type =='h5'">账号:{{ item.phone }}</view>
|
||||
<view class="phone" v-else>暂未绑定手机号</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="currentBnt acea-row row-center-wrapper font-color" v-if='item.uid === userInfo.uid'>
|
||||
当前账号
|
||||
</view>
|
||||
<view class="bnt font-color acea-row row-center-wrapper" v-else>
|
||||
使用账号
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class='list'>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>头像</view>
|
||||
<view class="pictrue" @click.stop='uploadpic'>
|
||||
<image :src='userInfo.avatar'></image>
|
||||
<image src='../../../static/images/alter.png' class="alter"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>昵称</view>
|
||||
<view class='input'><input type='text' name='nickname' :value='userInfo.nickname'></input></view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>手机号码</view>
|
||||
<navigator url="/pages/user_phone/index" hover-class="none" class="input" v-if="!userInfo.phone">
|
||||
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
|
||||
</navigator>
|
||||
<view class='input acea-row row-between-wrapper' v-else>
|
||||
<input type='text' disabled='true' name='phone' :value='userInfo.phone' class='id'></input>
|
||||
<text class='iconfont icon-suozi'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>ID号</view>
|
||||
<view class='input acea-row row-between-wrapper'>
|
||||
<input type='text' :value='userInfo.uid' disabled='true' class='id'></input>
|
||||
<text class='iconfont icon-suozi'></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>权限设置</view>
|
||||
<view class="input" @click="Setting">
|
||||
点击管理<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone && userInfo.user_type == 'h5'">
|
||||
<view>密码</view>
|
||||
<navigator url="/pages/user_pwd_edit/index" hover-class="none" class="input">
|
||||
点击修改密码<text class="iconfont icon-xiangyou"></text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin" v-if="!this.$wechat.isWeixin()">退出登录</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getUserInfo,
|
||||
userEdit,
|
||||
getLogout
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
switchH5Login
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},
|
||||
loginType: 'h5', //app.globalData.loginType
|
||||
userIndex: 0,
|
||||
switchUserInfo: [],
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false //是否隐藏授权
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 授权回调
|
||||
*/
|
||||
onLoadFun: function() {
|
||||
this.getUserInfo();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
/**
|
||||
* 小程序设置
|
||||
*/
|
||||
Setting: function() {
|
||||
uni.openSetting({
|
||||
success: function(res) {
|
||||
console.log(res.authSetting)
|
||||
}
|
||||
});
|
||||
},
|
||||
switchAccounts: function(index) {
|
||||
let userInfo = this.switchUserInfo[index],
|
||||
that = this;
|
||||
that.userIndex = index;
|
||||
if (that.switchUserInfo.length <= 1) return true;
|
||||
if (userInfo === undefined) return that.$util.Tips({
|
||||
title: '切换的账号不存在'
|
||||
});
|
||||
if (userInfo.user_type === 'h5') {
|
||||
uni.showLoading({
|
||||
title: '正在切换中'
|
||||
});
|
||||
switchH5Login().then(res => {
|
||||
uni.hideLoading();
|
||||
let newTime = Math.round(new Date() / 1000);
|
||||
that.$store.commit("LOGIN", {
|
||||
'token': res.data.token,
|
||||
'time': dayjs(res.data.expires_time) - newTime
|
||||
});
|
||||
that.getUserInfo();
|
||||
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
} else {
|
||||
that.$store.commit("LOGOUT");
|
||||
uni.showLoading({
|
||||
title: '正在切换中'
|
||||
});
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
that.isAuto = true;
|
||||
that.$set(that, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 退出登录
|
||||
*
|
||||
*/
|
||||
outLogin: function() {
|
||||
let that = this;
|
||||
if (that.loginType == 'h5') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认退出登录?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
getLogout()
|
||||
.then(res => {
|
||||
that.$store.commit("LOGOUT");
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取用户详情
|
||||
*/
|
||||
getUserInfo: function() {
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
that.$set(that, 'userInfo', res.data);
|
||||
let switchUserInfo = res.data.switchUserInfo || [];
|
||||
for (let i = 0; i < switchUserInfo.length; i++) {
|
||||
if (switchUserInfo[i].uid == that.userInfo.uid) that.userIndex = i;
|
||||
// 切割h5用户;user_type状态:h5、routine(小程序)、wechat(公众号);注:只有h5未注册手机号时,h5才可和小程序或是公众号数据想通;
|
||||
//#ifdef H5
|
||||
if (
|
||||
!that.$wechat.isWeixin() &&
|
||||
switchUserInfo[i].user_type != "h5" &&
|
||||
switchUserInfo[i].phone === ""
|
||||
)
|
||||
switchUserInfo.splice(i, 1);
|
||||
//#endif
|
||||
}
|
||||
that.$set(that, "switchUserInfo", switchUserInfo);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
*/
|
||||
uploadpic: function() {
|
||||
let that = this;
|
||||
that.$util.uploadImageOne('upload/image', function(res){
|
||||
console.log('mmj');
|
||||
let userInfo = that.switchUserInfo[that.userIndex];
|
||||
if (userInfo !== undefined) {
|
||||
userInfo.avatar = res.data.url;
|
||||
}
|
||||
that.switchUserInfo[that.userIndex] = userInfo;
|
||||
that.$set(that,'switchUserInfo',that.switchUserInfo);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交修改
|
||||
*/
|
||||
formSubmit: function(e) {
|
||||
console.log(e);
|
||||
let that = this,
|
||||
value = e.detail.value,
|
||||
userInfo = that.switchUserInfo[that.userIndex];
|
||||
if (!value.nickname) return that.$util.Tips({
|
||||
title: '用户姓名不能为空'
|
||||
});
|
||||
console.log('666666666666666666');
|
||||
// value.avatar = userInfo.avatar;
|
||||
userEdit(value).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: res.msg,
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
}).catch(msg => {
|
||||
return that.$util.Tips({
|
||||
title: msg || '保存失败,您并没有修改'
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.personal-data .wrapper {
|
||||
margin: 10rpx 0;
|
||||
background-color: #fff;
|
||||
padding: 36rpx 30rpx 13rpx 30rpx;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .title {
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 32rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item {
|
||||
width: 690rpx;
|
||||
height: 160rpx;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 22rpx;
|
||||
padding: 0 30rpx;
|
||||
position: relative;
|
||||
border: 2rpx solid #f8f8f8;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item.on {
|
||||
border-color: #e93323;
|
||||
border-radius: 20rpx;
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAACgCAYAAADw+I85AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6M0QzNkY3NzlCNzJCMTFFOTgyNEU4QzhGQTRFRUY2REQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6M0QzNkY3N0FCNzJCMTFFOTgyNEU4QzhGQTRFRUY2REQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozRDM2Rjc3N0I3MkIxMUU5ODI0RThDOEZBNEVFRjZERCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozRDM2Rjc3OEI3MkIxMUU5ODI0RThDOEZBNEVFRjZERCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pn3rJMAAAArUSURBVHja7N3NXuLIGsDhqigK2Ou+grmEuf/t2fT+bOYKZn9aW5Q6qaQSIoKfoCQ8z29QRBSBzX+q31RiSikAAMDYVF4CAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUAQMgCAMAJuPQSAABMy79///XaXfJi5qy0YFUuqVzW9eWhvqzK9b1+/vpHyAIAcMjCqxs1tldj/zHl/6oU4rz+ctY2a3tzjO2n0F6tUqobMYZ5fX1V337XBm0MMbX3SuXnvv1peqcBAKYlXl+VSI2lZJuIzSuwi7pUY3/HFPsijYMPcVOps9hG7W19fRVT+50YT6TXvdUAABML2at5V6rdTdfNSmzXquX2FOKTr7trsVvBjeVOISzLyuyfNnNTOIWWFbIAAFNzfd2umjYrsmlWR+i8KuusXbhurudZgTZpU6w/p82Ka0oldJvb47z+cp3HDU5kQVbIAgBMTVwsmzitr1V1ni5C07Pd5EAXtCVlm3BNTfS27dvGbAiDcYPUr9TWvys91jetT2BEVsgCAEwuZOeLJkDr/+Z5sbXdb7UdCIixb9M2WDdjss2n4X274YN2LraJ3fzjeUTh9yk8TyELADC1kM0rsjHVTRpnTYam2I8LNBOuaRO0TbaWbQhidyRYKveLmz0P+vu223ZV8ZWtuYQsAADvD9nlTTMb23/dxelg9TUM4nSzRLvZsSANf274u9uvZnXm/hGyAAAcVHWzzKusl5uDtvq9YtvvpzZJmwGC+GS1tR83iHuGYMuPXtbfF7IAABxWXP7IyVkNT4awGQ/Y7FswHBkIW9e7W1Kfv0/GDKpTeJ5CFgBgapbLPAJQxX5X2DIuEPsdYtsSTak/nKv5Xir7GQxWZNvvlZGC/pReUcgCAHB41c2PnbfHrc+v3bbv61MhZAEAJibmkE1pXRdo9SRDuxXVuJWp3XBsGYDdfL9frx38jub767LVgZAFAOCAIdvsWpBjs5tlHZx4tvmQNhsVdH1bAjYO9pTtrlX9cEJvfQrPU8gCAExMdXOTPz3knQvCk/1iU4iDhO3HCuKT8yK0v6P/mfL9wTFf9W0PpzBvIGQBACYmLm7yOMCqDtB5f6hXak94UFo0lPMklO22ykFfg71mNyu3/ZkUNltz1b+7vYOQBQDgkCG7vMmxmWdkVyGfiWvH3rD9yWeb22O/KVdfuqVy29HZOBwuWKVmbEHIAgBw6JBdLMqKaryLMV3GwRFcqRykVXWt2g0V9KfyimV7rsEEbTkILLbDCXftqIGDvQAAOLTFsjtxwbrOzds6PJcpPT8pQnctlV6N/XlsBwd9lZXcsp/sbZXiuszJClkAAA4rzuclUpsl11UdoXcxxXm709Zg7rUp1fJ13KzKDnbfGhwQFu/qr1fdoGwUsgAAHD5kF32JlhD9E5ots+KiCv0JvAZzr3GzPUGJ235lNo8TpHjbBnF373QSz1PIAgBMLWSvrtoQTf3ga5YP0nqsP89jPgCs7dz2Q4xhu03T5mfuYnNyhTjYzSAE228BALDXv3//9aGf+/mf/5ai3Zy0q4wOrGOIv1NoznEwq0P3sv66yl+XLs0ztfV9wkOO2NieVKFP29SeKqyP2I/+fUIWAIDdZrP+6nDhdDMa0JyZ60+57LvPM9+0CJsfttq6NMetCVkAgIn57pXST0Zr7tOLEqzd552ELAAA3x2u3aV6zw8LWQAAvlKO1Vm5XHzmFwlZAABGE69CFgDgDb5z1vTnr3+m8BLmcL06VnMKWQCAwzRVt9rYHVWf5c2r8g4Bef/WVWi3tZq6WF6L6/DOmVchCwDwdcGWY+0q7N+ZKpa4vSj3y2F7H9ptr9IZvh5CFgDgm+UVx8UHgm0Ye7ehXaUVsEIWAOBLLEq0fTb+lqFdnb0d8WtxXS7fcq4EIQsA8HY5Pmc7bs9jAt0MbJ6HXZe460YLuhna7eDrVjF/j+x1yM9lHo48AytkAQAOY7EnYu9Cu7KadsRtd7DXqtzvqgTgdhTm3z2Gldmq/K0n0ZBCFgDgdd02UkM5UPNK6uMbf0eO2nyQV161XYanq5lX5fZTnpn91jGCfVUNAMB+OdwWOyL2f++I2KHH8rPrrds/cvDYV/XiTWhXkuOp/WEAAOy3axXy944QfY9uNXc7mK9P7Lnnlegf4UT/FV/IAgC8bHukII8HPB7g9z6W3/XSY32nvEK8DKe5SixkAQBecbkVcmlHfH7G9okRYvj+1c/chz9OLKqFLADAO23vUrAKhz0jV7dt10uP+dXhniP2YgxvjpAFANhvO+gejvAYD6885lfJK7D5oK44ljfH9lsAAPttL/o9HuExHl95zK+QdyS4HtubI2QBAPbbXp1cH+Ex1q885rEd4pS7J/F/GQAAvD1sx260EStkAQBelr4gZKtXHvNYlmOOWCELAPCy7X/2P8aBWBevPOYx5JXY2djfHCELALDf9oFYxzi+6PKVxzxGxF5N4c0RsgAA++3a4/WQ4wUxPF8ZfTji85lPJWKFLADAy3JUbp9565DbVF2H52cOWx3puczCCLfYErIAAB93vyM+DzEre7EjLO+P9Bzy+MJyam+MkAUAeNmf8HwngeUnO6raEZapPNYxem85xTdGyAIAvCwH5u2Ohsqnc/3IyuxF+dntDrsNh996K5aIjVN8Y4QsAMDr8tzq/Y6O+hHaA6jeEoqx3PfHjga7D8eZjZ2H42wZdhKcohYA4G1uw+5dBvKc61UJ0XxZh81esFW5zML+HQ9W4fmK7yHMwoR2KBCyAACf8zvs3oc1ltveG473R4rYqvydkyZkAQDeJ4fnQwnFj86ednO3x9pq6zN/m5AFAJiwVYnZbqzgrdGYAzavwu7aCeFQrs6l8YQsAMDH5BC9K5fcVHkmNR9YVQ3CNt8nz8s+DuL3mPJjz8/lDRCyAACf9/AFkfoWZzFSIGQBAF7x89c/Y/pzZ+fWdvaRBQCYhvm5PWEhCwAwftfn2HVCFgBg3GIJ2bMjZAEAxu06nNEBXkIWAGAaujOKnSUhCwAwXme7GitkAQDG66xXY2tJyAIAjNMsnPFqbG0tZAEAxun6zJ+/kAUAGKF8Bq9z77hHIQsAMD5XXoLwIGQBAMYlz8XOzvw1WAcrsgAAo2M1NoRV/iBkAQDGZeYlCPdCFgBgXHK7XYjYZrRAyAIAjMi5r8am+nI3rHoAAITsGNyWmBWyAAAjkncrOOexgjxSsBreIGQBAMbh8oyfew7Y2+0bhSwAgJA9ZQ+7Ivbcyx4AQMietvt9EStkAQDGIc/HntO/pKcSsCtlDwAwbufUbHkV9i4MdifwogAAjNfUdyvIJzhYhcHJDtQ9AMA0TGmsIJVYzZfH0B7M9fiRX/R/AQYA1i4UF+HkevkAAAAASUVORK5CYII=");
|
||||
background-size: 100% 100%;
|
||||
background-color: #fff9f9;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt {
|
||||
width: 445rpx;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt .pictrue {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt .pictrue .alter {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt .text {
|
||||
width: 325rpx;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt .text .name {
|
||||
width: 100%;
|
||||
font-size: 30rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .picTxt .text .phone {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .bnt {
|
||||
font-size: 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 27rpx;
|
||||
width: 140rpx;
|
||||
height: 54rpx;
|
||||
border: 2rpx solid #e93323;
|
||||
}
|
||||
|
||||
.personal-data .wrapper .wrapList .item .currentBnt {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
font-size: 26rpx;
|
||||
background-color: rgba(233, 51, 35, 0.1);
|
||||
width: 140rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 0 20rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.personal-data .list {
|
||||
margin-top: 15rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.personal-data .list .item {
|
||||
padding: 30rpx 30rpx 30rpx 0;
|
||||
border-bottom: 1rpx solid #f2f2f2;
|
||||
margin-left: 30rpx;
|
||||
font-size: 32rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.personal-data .list .item .phone {
|
||||
width: 160rpx;
|
||||
height: 56rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
line-height: 56rpx;
|
||||
border-radius: 32rpx
|
||||
}
|
||||
|
||||
.personal-data .list .item .pictrue {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.personal-data .list .item .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.personal-data .list .item .pictrue .alter{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.personal-data .list .item .input {
|
||||
width: 415rpx;
|
||||
text-align: right;
|
||||
color: #868686;
|
||||
}
|
||||
|
||||
.personal-data .list .item .input .id {
|
||||
width: 365rpx;
|
||||
}
|
||||
|
||||
.personal-data .list .item .input .iconfont {
|
||||
font-size: 35rpx;
|
||||
}
|
||||
|
||||
.personal-data .modifyBnt {
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
width: 690rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
margin: 76rpx auto 0 auto;
|
||||
}
|
||||
|
||||
.personal-data .logOut {
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
width: 690rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
margin: 30rpx auto 0 auto;
|
||||
}
|
||||
</style>
|
||||
@@ -12,16 +12,15 @@
|
||||
<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item}}</view>
|
||||
</view>
|
||||
<view class='tip picList' v-if='!active'>
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic == index ? 'pic-box-color-active' : ''"
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic === index ? 'pic-box-color-active' : ''"
|
||||
v-for="(item, index) in picList" :key="index" @click="picCharge(index, item)">
|
||||
<view class="pic-number-pic">
|
||||
{{ item.price }}<span class="pic-number"> 元</span>
|
||||
</view>
|
||||
<view class="pic-number">赠送:{{ item.giveMoney }} 元</view>
|
||||
</view>
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="activePic == picList.length ? 'pic-box-color-active' : ''"
|
||||
@click="picCharge(picList.length)">
|
||||
<input type="number" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic" :class="activePic == picList.length ? 'pic-box-color-active' : ''" />
|
||||
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="parseFloat(activePic)===parseFloat(picList.length)?'pic-box-color-active':''" @click="picCharge(picList.length)">
|
||||
<input type="number" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
|
||||
</view>
|
||||
<view class="tips-box">
|
||||
<view class="tips mt-30">注意事项:</view>
|
||||
@@ -485,12 +484,11 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pic-box-color-active {
|
||||
}
|
||||
.pic-box-color-active {
|
||||
background-color: #ec3323 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.tips-box {
|
||||
.tips {
|
||||
font-size: 28rpx;
|
||||
|
||||
@@ -124,8 +124,6 @@
|
||||
let loadend = list.length < that.limit;
|
||||
that.orderList = that.$util.SplitArray(list, that.orderList);
|
||||
that.$set(that,'orderList',that.orderList);
|
||||
console.log('8888888888888888888');
|
||||
console.log(that.orderList);
|
||||
that.loadend = loadend;
|
||||
that.loading = false;
|
||||
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="height: 100%;">
|
||||
<view class='distribution-posters'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
|
||||
@change="bindchange" previous-margin="40px" next-margin="40px">
|
||||
@@ -23,9 +23,9 @@
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
<view class="canvas">
|
||||
<view class="canvas" v-if="canvasStatus">
|
||||
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
|
||||
<canvas style="" canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
|
||||
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -76,11 +76,10 @@
|
||||
poster: '',
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
imagePath: '',
|
||||
qrcodeSize: 1000,
|
||||
PromotionCode: '',
|
||||
base64List: [],
|
||||
posterbackgd: 'https://image.java.crmeb.net/image/product/2020/08/03/755bf516b1ca4b6db3bfeaa4dd5901cdh71kob20re.jpg'
|
||||
canvasStatus: true //海报绘图标签
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
@@ -143,7 +142,6 @@
|
||||
imageBase64({url:item.pic}).then(res=>{
|
||||
spreadList[index] = res.data.code;
|
||||
that.$set(that,'base64List',spreadList);
|
||||
//that.$set(that, 'poster', spreadList[0]);
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
@@ -153,7 +151,6 @@
|
||||
});
|
||||
// #endif
|
||||
that.userInfos();
|
||||
console.log('上',this.base64List)
|
||||
},
|
||||
// 小程序二维码
|
||||
getQrcode(){
|
||||
@@ -164,7 +161,7 @@
|
||||
}
|
||||
let arrImagesUrl = "";
|
||||
uni.downloadFile({
|
||||
url: this.base64List[0], //仅为示例,并非真实的资源
|
||||
url: this.base64List[0],
|
||||
success: (res) => {
|
||||
arrImagesUrl = res.tempFilePath;
|
||||
}
|
||||
@@ -172,12 +169,18 @@
|
||||
getQrcode(data).then(res=>{
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
console.log('第一张',that.PromotionCode)
|
||||
});
|
||||
setTimeout(() => {
|
||||
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
|
||||
}, 200);
|
||||
})
|
||||
}, 300);
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
that.$set(that, 'canvasStatus', false);
|
||||
//that.getQrcode();
|
||||
});
|
||||
},
|
||||
// 生成二维码;
|
||||
make() {
|
||||
@@ -190,10 +193,14 @@
|
||||
margin: 10,
|
||||
success: res => {
|
||||
that.PromotionCode = res;
|
||||
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname,0);
|
||||
setTimeout(() => {
|
||||
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname,0);
|
||||
}, 300);
|
||||
},
|
||||
complete: (res) => {
|
||||
},
|
||||
complete: () => {},
|
||||
fail: res => {
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: '海报二维码生成失败!'
|
||||
});
|
||||
@@ -222,35 +229,17 @@
|
||||
canvasId: 'canvasOne',
|
||||
fileType: 'jpg',
|
||||
success: function(res) {
|
||||
console.log("成功",res)
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.hideLoading();
|
||||
that.imagePath = res.tempFilePath;
|
||||
that.spreadList[index].pic = res.tempFilePath;
|
||||
that.poster = res.tempFilePath;
|
||||
console.log("spreadList = ", that.spreadList[index].pic)
|
||||
that.$set(that, 'poster', res.tempFilePath);
|
||||
that.$set(that, 'canvasStatus', false);
|
||||
}
|
||||
})
|
||||
})
|
||||
}, 100);
|
||||
// context.draw(true,function(){
|
||||
// uni.canvasToTempFilePath({
|
||||
// destWidth: 750,
|
||||
// destHeight: 1190,
|
||||
// canvasId: 'canvasOne',
|
||||
// fileType: 'jpg',
|
||||
// success: function(res) {
|
||||
// console.log("成功",res)
|
||||
// // 在H5平台下,tempFilePath 为 base64
|
||||
// uni.hideLoading();
|
||||
// that.imagePath = res.tempFilePath;
|
||||
// that.spreadList[index].pic = res.tempFilePath;
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log("失败",err)
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: '无法获取图片信息'
|
||||
@@ -274,99 +263,59 @@
|
||||
this.swiperIndex = index;
|
||||
let arrImagesUrl = "";
|
||||
uni.downloadFile({
|
||||
url: base64List[index], //仅为示例,并非真实的资源
|
||||
url: base64List[index],
|
||||
success: (res) => {
|
||||
console.log('移动',res)
|
||||
arrImagesUrl = res.tempFilePath;
|
||||
console.log('移动图片',arrImagesUrl)
|
||||
console.log('移动二维码',this.PromotionCode)
|
||||
setTimeout(() => {
|
||||
this.$set(this, 'canvasStatus', true);
|
||||
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname, index);
|
||||
}, 200);
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击保存海报
|
||||
savePosterPath: function() {
|
||||
let that = this;
|
||||
uni.downloadFile({
|
||||
url: that.poster,
|
||||
success(resFile) {
|
||||
if (resFile.statusCode === 200) {
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: resFile.tempFilePath,
|
||||
success: function(res) {
|
||||
return that.$util.Tips({
|
||||
title: '保存成功'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
},
|
||||
complete: function(res) {},
|
||||
})
|
||||
},
|
||||
fail() {
|
||||
uni.showModal({
|
||||
title: '您已拒绝获取相册权限',
|
||||
content: '是否进入权限管理,调整授权?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: function(res) {
|
||||
console.log(res.authSetting)
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
return that.$util.Tips({
|
||||
title: '已取消!'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: resFile.tempFilePath,
|
||||
success: function(res) {
|
||||
return that.$util.Tips({
|
||||
title: '保存成功'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
},
|
||||
complete: function(res) {},
|
||||
})
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.poster,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: '保存失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return that.$util.Tips({
|
||||
title: resFile
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.poster,
|
||||
success: function(res) {
|
||||
that.$util.Tips({
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
that.$util.Tips({
|
||||
title: '保存失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
userInfos() {
|
||||
let that = this;
|
||||
@@ -399,11 +348,18 @@
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #a3a3a3 !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.canvas{
|
||||
position: fixed;
|
||||
z-index: -5rpx;
|
||||
opacity: 0;
|
||||
position: relative;
|
||||
}
|
||||
.distribution-posters{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.distribution-posters swiper {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user