## v1.3.1 更新列表

1. 【修复】申请退款后积分等操作可能出现错误的问题
	2. 【修复】拼团支付可能出现支付错误的问题
	3. 【修复】退款申请后的订单流程优化和积分赠送的问题
	4. 【修复】回收站中的商品无法恢复的问题
	5. 【修复】一号通短信查询记录不完整的问题
	6. 【修复】用户管理批量加分组,标签的问题
	7. 【修复】积分日志搜索显示有误的问题
	8. 【修复】手动发送优惠券可能会出错的问题
	9. 【修复】核销订单创建在某种条件下会出错的问题
	10. 【修复】移动端商品详情,购物车等样式兼容问题
	11. 【修复】业务流程性的优化
pull/1/MERGE
stivepeim 2021-01-19 10:16:45 +08:00
parent a6f622572a
commit 621819b067
55 changed files with 761 additions and 3338 deletions

View File

@ -125,7 +125,7 @@ export function getOrderDetail(uni) {
*/
export function orderAgain(uni) {
return request.post('order/again', {
nui: uni
orderNo: uni
});
}
@ -161,7 +161,7 @@ export function ordeRefundReason() {
* @param object data
*/
export function orderRefundVerify(data) {
return request.post('order/refund/verify', data);
return request.post('order/refund', data);
}
/**
@ -176,7 +176,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
secKill: secKill,
combination:combination,
bargain:bargain
}, {}, 1);
});
}
/**
@ -214,4 +214,20 @@ export function postOrderComputed(key, data) {
*/
export function qrcodeApi(data) {
return request.post('qrcode/str2base64', data, {}, 1);
}
/**
* 微信订单支付
* @param object data
*/
export function wechatOrderPay(data) {
return request.post('pay/payment', data);
}
/**
* 微信查询支付结果
* @param object data
*/
export function wechatQueryPayResult(data) {
return request.get('pay/queryPayResult', data);
}

View File

@ -78,3 +78,10 @@ export function copyWords() {
return request.get("copy_words", {}, { noAuth: true });
}
/**
* 首页 获取客服地址
* @returns {*}
*/
export function kefuConfig() {
return request.get("config", {}, { noAuth: true });
}

View File

@ -390,9 +390,9 @@ export function getlevelInfo()
* 经验值明细
*
*/
export function getlevelExpList()
export function getlevelExpList(data)
{
return request.get("user/expList");
return request.get("user/expList",data);
}
/**

View File

@ -1,154 +0,0 @@
<template>
<view>
<view class='Popup' v-if='isShowAuth'>
<image :src='logoUrl'></image>
<view class='title'>授权提醒</view>
<view class='tip'>请授权头像等信息以便为您提供更好的服务</view>
<view class='bottom flex'>
<view class='item' @click='close'>随便逛逛</view>
<!-- #ifdef APP-PLUS -->
<button class='item grant' @click="setUserInfo"></button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class='item grant' type="primary" open-type="getPhoneNumber" lang="zh_CN" @getphonenumber="setUserInfo"></button>
<!-- #endif -->
</view>
</view>
<view class='mask' v-if='isShowAuth' @click='close'></view>
</view>
</template>
<script>
const app = getApp();
import Cache from '../utils/cache';
import { getLogo } from '../api/public';
import { LOGO_URL } from '../config/cache';
import { mapGetters } from 'vuex';
import Routine from '../libs/routine';
export default {
name:'Authorize',
props:{
isAuto:{
type:Boolean,
default:true
},
isGoIndex:{
type:Boolean,
default:true
},
isShowAuth:{
type:Boolean,
default:false
}
},
data(){
return {
logoUrl:''
}
},
computed:mapGetters(['isLogin','userInfo']),
watch:{
isLogin(n){
n === true && this.$emit('onLoadFun',this.userInfo);
}
},
created() {
this.getLogoUrl();
this.setAuthStatus();
},
methods:{
setAuthStatus(){
Routine.authorize().then(res=>{
if(res.islogin === false)
this.setUserInfo();
else
this.$emit('onLoadFun',this.userInfo);
}).catch(res=>{
if (this.isAuto)
this.$emit('authColse',true);
})
},
getUserInfo(code){
console.log(456);
Routine.getUserInfo().then(res=>{
console.log(123);
console.log(res);
let userInfo = res.userInfo
userInfo.code = code;
userInfo.spread_spid = app.globalData.spid;//广ID
userInfo.spread_code = app.globalData.code;//广ID
userInfo.avatar = userInfo.userInfo.avatarUrl;
userInfo.city = userInfo.userInfo.city;
userInfo.country = userInfo.userInfo.country;
userInfo.nickName = userInfo.userInfo.nickName;
userInfo.province = userInfo.userInfo.province;
userInfo.sex = userInfo.userInfo.gender;
Routine.authUserInfo(code,userInfo).then(res=>{
uni.hideLoading();
this.$emit('authColse',false);
this.$emit('onLoadFun',this.userInfo);
}).catch(res=>{
uni.hideLoading();
uni.showToast({
title:res.msg,
icon:'none',
duration:2000
});
})
}).catch(res =>{
uni.hideLoading();
})
},
setUserInfo(e){
console.log('78878787');
console.log(e);
uni.showLoading({title:'正在登录中'});
if(e.detail.errMsg == "getPhoneNumber:ok"){
console.log('授权成功');
Routine.getCode().then(code=>{
console.log(code);
this.getUserInfo(code);
}).catch(res=>{
uni.hideLoading();
})
}
},
getLogoUrl(){
let that = this;
if (Cache.has(LOGO_URL)) {
this.logoUrl = Cache.get(LOGO_URL);
return;
}
getLogo().then(res=>{
that.logoUrl = res.data.logo_url
Cache.set(LOGO_URL,that.logoUrl);
})
},
close(){
let pages = getCurrentPages(), currPage = pages[pages.length - 1];
if(this.isGoIndex){
uni.switchTab({url:'/pages/index/index'});
} else {
this.$emit('authColse',false);
}
// if (currPage && currPage.isShowAuth != undefined){
// currPage.isShowAuth = true;
// }
},
}
}
</script>
<style scoped lang='scss'>
.Popup{width:500rpx;background-color:#fff;position:fixed;top:50%;left:50%;margin-left:-250rpx;transform:translateY(-50%);z-index:320;}
.Popup image{width:150rpx;height:150rpx;margin:-67rpx auto 0 auto;display:block;border: 8rpx solid #fff;border-radius: 50%}
.Popup .title{font-size:28rpx;color:#000;text-align:center;margin-top: 30rpx}
.Popup .tip{font-size:22rpx;color:#555;padding:0 24rpx;margin-top:25rpx;}
.Popup .bottom .item{width:50%;height:80rpx;background-color:#eeeeee;text-align:center;line-height:80rpx;font-size:24rpx;color:#666;margin-top:54rpx;}
.Popup .bottom .item.on{width: 100%}
.flex{display:flex;}
.Popup .bottom .item.grant{font-size:28rpx;color:#fff;font-weight:bold;background-color:#e93323;border-radius:0;padding:0;}
.mask{position:fixed;top:0;right:0;left:0;bottom:0;background-color:rgba(0,0,0,0.65);z-index:310;}
</style>

View File

@ -9,16 +9,17 @@
<view class="pic-num">{{item.minPrice}}元可用</view>
</view>
<view class='text'>
<view class='condition line1'>
<span class='line-title' :class='item.isUse?"gray":""' v-if='item.type===0'>通用劵</span>
<span class='line-title' :class='item.isUse?"gray":""' v-else-if='item.type===1'>品类券</span>
<span class='line-title' :class='item.isUse?"gray":""' v-else></span>
<view class='condition line2'>
<span class='line-title' :class='item.isUse?"gray":""' v-if='item.useType===1'>通用</span>
<span class='line-title' :class='item.isUse?"gray":""' v-else-if='item.useType===3'>品类</span>
<span class='line-title' :class='item.isUse?"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 class='bnt gray' v-if="item.isUse">{{item.use_title || ''}}</view>
<view class='bnt bg-color' v-else>{{coupon.statusTile || ''}}</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">{{item.use_title || ''}}</view>
<view class='bnt bg-color' v-else>{{coupon.statusTile || ''}}</view>
</view>
</view>
</view>

View File

@ -1,173 +0,0 @@
<template>
<view>
<view class='coupon-list-window' :class='coupon.coupon==true?"on":""'>
<view class='title'>优惠券<text class='iconfont icon-guanbi' @click='close'></text></view>
<view class='coupon-list' v-if="coupon.list.length">
<view class='item acea-row row-center-wrapper' v-for="(item,index) in coupon.list" @click="getCouponUser(index,item)"
:key='index'>
<view class='money'>
<div>
<span class="num">{{ item.coupon_price }}</span>
</div>
<div class="pic-num">{{ item.use_min_price }}元可用</div>
</view>
<view class='text'>
<view class='condition line1'>
<span class="line-title" v-if="item.type === 0"></span>
<span class="line-title" v-else-if="item.type === 1">品类券</span>
<span class="line-title" v-else></span>
<span>{{ item.title }}</span>
</view>
<view class='data acea-row row-between-wrapper'>
<view>{{ item.start_time ? item.start_time + "-" : ""}}{{ item.end_time }}</view>
<view class="iconfont icon-xuanzhong1 font-color-red" v-if="checked.id === item.id"></view>
<view v-else class="iconfont icon-weixuanzhong"></view v-else>
<!-- <view class='bnt gray' v-if="item.is_use">{{item.use_title || ''}}</view>
<view class='bnt bg-color' v-else>{{coupon.statusTile || ''}}</view> -->
</view>
</view>
</view>
</view>
<!-- 无优惠券 -->
<view class='pictrue' v-else>
<image src='../../static/images/noCoupon.png'></image>
</view>
</view>
<view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view>
</view>
</template>
<script>
import {
setCouponReceive
} from '@/api/api.js';
export default {
props: {
// 0=,1=使
openType: {
type: Number,
default: 0,
},
coupon: {
type: Object,
default: function() {
return {};
}
},
checked:{
type: Object,
default: function() {
return {};
}
},
},
data() {
return {
};
},
methods: {
close: function() {
this.$emit('ChangCouponsClone');
},
getCouponUser: function(index, item) {
let that = this;
let list = that.coupon.list;
that.$emit('ChangCoupons', item);
// if (list[index].is_use == true && this.openType == 0) return true;
// switch (this.openType) {
// case 0:
// //
// setCouponReceive(id).then(res => {
// that.$emit('ChangCouponsUseState', index);
// that.$util.Tips({
// title: ""
// });
// that.$emit('ChangCoupons', list[index]);
// })
// break;
// case 1:
// that.$emit('ChangCoupons', index);
// break;
// }
}
}
}
</script>
<style scoped lang="scss">
.coupon-list-window {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #f5f5f5;
border-radius: 16rpx 16rpx 0 0;
z-index: 555;
transform: translate3d(0, 100%, 0);
transition: all .3s cubic-bezier(.25, .5, .5, .9);
}
.coupon-list-window.on {
transform: translate3d(0, 0, 0);
}
.coupon-list-window .title {
height: 124rpx;
width: 100%;
text-align: center;
line-height: 124rpx;
font-size: 32rpx;
font-weight: bold;
position: relative;
}
.coupon-list-window .title .iconfont {
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-50%);
font-size: 35rpx;
color: #8a8a8a;
font-weight: normal;
}
.coupon-list-window .coupon-list {
margin: 0 0 50rpx 0;
height: 550rpx;
overflow: auto;
}
.coupon-list-window .pictrue {
width: 414rpx;
height: 336rpx;
margin: 0 auto 50rpx auto;
}
.coupon-list-window .pictrue image {
width: 100%;
height: 100%;
}
.coupon-list .item .money{
display: flex;
flex-direction: column;
justify-content: center;
.pic-num{
color: #ffffff;
font-size: 24rpx;
}
}
.condition .line-title{
width: 90rpx;
padding: 0 10rpx;
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;
color: #e83323;
margin-right: 12rpx;
}
</style>

View File

@ -6,7 +6,8 @@
<view class='money font-color'><text class='num'>{{item.money}}</text></view>
<view class='text'>
<view class='name'>购物买{{item.minPrice}}{{item.money}}</view>
<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>
</view>
</view>

View File

@ -25,7 +25,8 @@
<script>
import {
orderPay
orderPay,
wechatOrderPay
} from '@/api/order.js';
export default {
props: {
@ -69,36 +70,23 @@
});
uni.showLoading({
title: '支付中'
});
orderPay({
uni: that.order_id,
paytype: paytype,
// #ifdef MP
'from': 'routine',
// #endif
// #ifdef H5 || APP-PLUS
'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5'
// #endif
// // #ifdef H5
// quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location.port + '/pages/users/order_details/index?order_id=' + this.order_id : location.protocol + '//' + location.hostname +
// '/pages/users/order_details/index?order_id=' + that.order_id
// // #endif
});
wechatOrderPay({
orderNo: that.order_id,
payChannel: this.$wechat.isWeixin() ? 'public' : 'weixinh5',
payType: paytype
}).then(res => {
switch (paytype) {
let jsConfig = res.data.jsConfig;
switch (res.data.payType) {
case 'weixin':
if (res.data.result === undefined) return that.$util.Tips({
title: '缺少支付参数'
});
// #ifdef MP || APP-PLUS
let jsConfig = res.data.jsConfig;
// let packages = 'prepay_id=' + jsConfig.prepayId;
// #ifdef MP
uni.requestPayment({
timeStamp: jsConfig.timeStamp.toString(),
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.package,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
success: function(ress) {
uni.hideLoading();
return that.$util.Tips({
title: '支付成功',
@ -129,21 +117,25 @@
});
});
},
});
})
// #endif
// #ifdef H5
if (res.data.status === "WECHAT_PAY") {
let jsConfig = res.data.jsConfig;
//let packages = 'prepay_id=' + jsConfig.prepayId;
let datas = {
timestamp:jsConfig.timeStamp,
nonceStr:jsConfig.nonceStr,
package:jsConfig.package,
signType:jsConfig.signType,
paySign:jsConfig.paySign
};
that.$wechat.pay(datas)
.then(() => {
let datas = {
timestamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign
};
that.$wechat.pay(datas).then(res => {
if (res.errMsg == 'chooseWXPay:cancel') {
return that.$util.Tips({
title: '支付失败'
});
} else {
wechatQueryPayResult({
orderNo: that.order_id
}).then(res => {
return that.$util.Tips({
title: "支付成功",
icon: 'success'
@ -152,24 +144,14 @@
action: 'pay_complete'
});
});
})
.catch(function() {
}).cache(errW => {
return that.$util.Tips({
title: '支付失败'
title: errW
});
});
} else {
uni.hideLoading();
location.replace(res.data.jsConfig.h5PayUrl);
return that.$util.Tips({
title: "支付成功",
icon: 'success'
}, () => {
that.$emit('onChangeFun', {
action: 'pay_complete'
});
});
}
})
}
})
// #endif
break;
case 'yue':
@ -183,18 +165,132 @@
});
});
break;
case 'offline':
uni.hideLoading();
return that.$util.Tips({
title: '线下支付成功',
icon: 'success'
}, () => {
that.$emit('onChangeFun', {
action: 'pay_complete'
});
});
break;
case 'weixinh5':
uni.hideLoading();
location.replace(jsConfig.mwebUrl);
return that.$util.Tips({
title: "支付成功",
icon: 'success'
}, () => {
that.$emit('onChangeFun', {
action: 'pay_complete'
});
});
break;
}
// switch (paytype) {
// case 'weixin':
// if (res.data.result === undefined) return that.$util.Tips({
// title: ''
// });
// // #ifdef MP || APP-PLUS
// let jsConfig = res.data.jsConfig;
// uni.requestPayment({
// timeStamp: jsConfig.timeStamp.toString(),
// nonceStr: jsConfig.nonceStr,
// package: jsConfig.package,
// signType: jsConfig.signType,
// paySign: jsConfig.paySign,
// success: function(res) {
// uni.hideLoading();
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_complete'
// });
// });
// },
// fail: function(e) {
// uni.hideLoading();
// return that.$util.Tips({
// title: ''
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_fail'
// });
// });
// },
// complete: function(e) {
// uni.hideLoading();
// if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
// title: ''
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_fail'
// });
// });
// },
// });
// // #endif
// // #ifdef H5
// if (res.data.status === "WECHAT_PAY") {
// let jsConfig = res.data.jsConfig;
// //let packages = 'prepay_id=' + jsConfig.prepayId;
// let datas = {
// timestamp:jsConfig.timeStamp,
// nonceStr:jsConfig.nonceStr,
// package:jsConfig.package,
// signType:jsConfig.signType,
// paySign:jsConfig.paySign
// };
// that.$wechat.pay(datas)
// .then(() => {
// return that.$util.Tips({
// title: "",
// icon: 'success'
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_complete'
// });
// });
// })
// .catch(function() {
// return that.$util.Tips({
// title: ''
// });
// });
// } else {
// uni.hideLoading();
// location.replace(res.data.jsConfig.h5PayUrl);
// return that.$util.Tips({
// title: "",
// icon: 'success'
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_complete'
// });
// });
// }
// // #endif
// break;
// case 'yue':
// uni.hideLoading();
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_complete'
// });
// });
// break;
// case 'offline':
// uni.hideLoading();
// return that.$util.Tips({
// title: '线',
// icon: 'success'
// }, () => {
// that.$emit('onChangeFun', {
// action: 'pay_complete'
// });
// });
// break;
// }
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({

View File

@ -93,7 +93,6 @@
return {};
},
mounted() {
console.log(this.attr)
},
methods: {
goCat:function(){

View File

@ -12,7 +12,7 @@
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;align-items: center; height: 100%;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="false">
<view class="wrapper">
<view v-for="(item,index) in tabTitle[tabClick].child?tabTitle[tabClick].child:[]" :key="index" class="child-item" :class="{on:index == childIndex}" @click="childTab(tabClick,index)">
<image :src="item.extra" mode=""></image>
<image :src="item.extra" mode="" :style="{'background-color':item.extra?'none':'#f7f7f7'}"></image>
<view class="txt line1">{{item.name}}</view>
</view>
</view>

View File

@ -11,10 +11,12 @@
<view class="start" :class="'star' + item.productScore"></view>
</view>
<view class="time">{{ item.createTime }}</view>
<!-- <view class="time">{{ item.createTime }} {{ item.suk }}</view> -->
<!-- <view class="time">{{ item.createTime }}</view>
<view class="time">{{ item.suk }}</view> -->
<!-- <view class="time">{{ item.createTime }} {{ item.sku }}</view> -->
</view>
</view>
<view class="time">规格{{ item.sku?item.sku:'无' }}</view>
<view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row" v-if="item.pics.length && item.pics[0]">
<view class="pictrue" v-for="(itemn, indexn) in item.pics" :key="indexn">

View File

@ -648,7 +648,6 @@ const initPicker={
let bDate=new Date(tYear,curMonth,curDate).getTime();
let months=[];
if(bDate-aDate>0){
console.log(1)
for(let m=1;m<=12;m++){
months.push(forMatNum(m));
};

View File

@ -312,7 +312,6 @@
},
defaultVal(val){
this.initData();
console.log(val)
},
areaCode(){
this.initData();

View File

@ -51,16 +51,13 @@ class AuthWechat {
// if (this.status && !this.isAndroid()) return resolve(this.instance);
getWechatConfig()
.then(res => {
let data = res.data;
// delete data.jsApiTicket;
this.instance.config(data);
this.initConfig = data;
this.instance.config(res.data);
this.initConfig = res.data;
this.status = true;
this.instance.ready(() => {
resolve(this.instance);
})
}).catch(err => {
console.log(err);
this.status = false;
reject(err);
});
@ -124,14 +121,15 @@ class AuthWechat {
this.toPromise(wx.chooseWXPay, config).then(res => {
resolve(res);
}).catch(res => {
reject(res);
console.log('js中的错误',res)
resolve(res);
});
}).catch(res => {
reject(res);
});
});
}
toPromise(fn, config = {}) {
return new Promise((resolve, reject) => {
fn({
@ -174,7 +172,6 @@ class AuthWechat {
auth(code) {
return new Promise((resolve, reject) => {
let loginType = Cache.get(LOGINTYPE);
console.log('spread', Cache.get("spread"))
wechatAuth(code, Cache.get("spread"), loginType)
.then(({
data
@ -252,7 +249,6 @@ class AuthWechat {
})
},
success(res) {
console.log(res);
return resolve(res,2222);
}
};

View File

@ -359,7 +359,6 @@
}
if (this.isLogin) {
console.log(that.bargainUid,'that.bargainUid')
if(that.bargainUid == 'undefined'){
that.bargainUid = that.$store.state.app.uid
}

View File

@ -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;
});

View File

@ -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({

View File

@ -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(){

View File

@ -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)
// H5tempFilePath 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: '无法获取图片信息'

View File

@ -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
}
}

View File

@ -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)
}

View File

@ -228,7 +228,6 @@
that.init();
},
err => {
console.log(err,'err')
that.change = false;
that.$util.Tips({title: err});
}

View File

@ -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)

View File

@ -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{

View File

@ -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 {

View File

@ -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 = [];
console.log(this.productValue)
for (let key in this.productValue) {
if (this.productValue[key].stock > 0) {
value = this.attr.productAttr.length ? key.split(",") : [];
@ -1040,7 +1040,6 @@
},
//
authColse: function(e) {
console.log(e, 'eeeee')
this.isShowAuth = e
},
/**
@ -1116,16 +1115,18 @@
//that.PromotionCode = res.data.code;
base64src(res.data.code, res => {
that.PromotionCode = res;
console.log('第一张',that.PromotionCode)
});
})
}).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;
console.log(href)
uQRCode.make({
canvasId: 'qrcode',
text: href,
@ -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;
that.posters = false;
@ -1232,14 +1194,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.imagePath = tempFilePath;
that.canvasStatus = true;
});
}, 200);
}
});
});
},
/*
* 保存到手机相册

File diff suppressed because one or more lines are too long

View File

@ -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>

View File

@ -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) {

View File

@ -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;
}

View File

@ -475,7 +475,7 @@
let selectValueProductId = that.getSelectValueProductId();
collectAll(that.getSelectValueProductId()).then(res => {
return that.$util.Tips({
title: res,
title: '收藏成功',
icon: 'success'
});
}).catch(err => {

View File

@ -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)
}
},

View File

@ -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 = [{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 = '加载更多';
})
}
},

View File

@ -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: "正在发布评论……"
});

View File

@ -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({

View File

@ -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,

View File

@ -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({

View File

@ -153,7 +153,9 @@
getCouponsOrderPrice,
orderCreate,
postOrderComputed,
orderPay
orderPay,
wechatOrderPay,
wechatQueryPayResult
} from '@/api/order.js';
import {
getAddressDefault,
@ -211,11 +213,11 @@
payStatus: 1,
},
{
"name": "线下支付",//offlinePayStatu1线2offlinePostagetrue
"name": "线下支付", //offlinePayStatu1线2offlinePostagetrue
"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
}
}
}

View File

@ -143,7 +143,6 @@
this.isShowAuth = e
},
setSort: function(sortKey,isAsc) {
console.log(sortKey);
let that = this;
that.isAsc = isAsc;
that.sort = sortKey+isAsc;

View File

@ -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;

View File

@ -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;
}

View File

@ -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>

View File

@ -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;
// h5user_typeh5routinewechath5h5
//#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/Pn3rJMAAAArUSURBVHja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");
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>

View File

@ -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;

View File

@ -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 ? "我也是有底线的" : '加载更多';

View File

@ -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)
// H5tempFilePath 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)
// // H5tempFilePath 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%;

View File

@ -192,11 +192,12 @@
page {
font-size: 28rpx;
background-color: #f5f5f5;
color: #333
color: #333;
/* height: 100%; */
}
body,html {
height: unset
/* height: unset */
}
button {

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
const fsm = wx.getFileSystemManager();
const fsm = uni.getFileSystemManager ? uni.getFileSystemManager() : null;
const FILE_BASE_NAME = 'tmp_base64src'; //自定义文件名
export function base64src(base64data, cb) {

View File

@ -157,157 +157,124 @@ import {
arr.push(text.slice(str, text.length));
return [strLength, arr, rows] // [处理文字的总字节长度,每行显示内容的数组,行数]
},
// 生成海报
PosterCanvas:function(arrImages, storeName, price, successFn){
/**
* 获取分享海报
* @param array arr2 海报素材
* @param string store_name 素材文字
* @param string price 价格
* @param string ot_price 原始价格
* @param function successFn 回调函数
*
*
*/
PosterCanvas: function(arr2, store_name, price,ot_price, successFn) {
let that = this;
uni.showLoading({
title: '海报生成中',
mask: true
});
let context = uni.createCanvasContext('firstCanvas')
context.clearRect(0, 0, 0, 0);
let that = this;
const ctx = uni.createCanvasContext('firstCanvas');
ctx.clearRect(0, 0, 0, 0);
/**
* 只能获取合法域名下的图片信息,本地调试无法获取
*
*/
ctx.fillStyle = '#fff';
ctx.fillRect(0, 0, 750, 1150);
uni.getImageInfo({
src: arrImages[0],
success: function (image) {
console.log('image成功', image)
context.drawImage(arrImages[0], 0, 0, 750, 1190);
context.drawImage(arrImages[1], 0, 0, 750, 750);
context.save();
context.drawImage(arrImages[2], 110, 1000, 140, 140);
context.restore();
context.setFontSize(30);
context.setTextAlign('center');
let maxText = 28;
let text = storeName;
let topText = '';
let bottomText = '';
let len = text.length;
if(len>maxText*2){
text = text.slice(0,maxText*2-4)+'......';
topText = text.slice(0,maxText-1);
bottomText = text.slice(maxText-1,len);
}else{
if(len>maxText){
topText = text.slice(0,maxText-1);
bottomText = text.slice(maxText-1,len);
}else{
topText = text;
bottomText = '';
}
}
context.fillText(topText, 750/2, 800);
context.fillText(bottomText, 750/2, 840);
context.setFontSize(37);
context.setTextAlign('center');
context.setFillStyle('#fc4141');
context.fillText('¥' + price, 750 / 2, 900);
context.draw(true,function(){
uni.canvasToTempFilePath({
destWidth: 750,
destHeight: 1190,
canvasId: 'firstCanvas',
fileType: 'jpg',
success: function(res) {
console.log(res.tempFilePath)
// 在H5平台下tempFilePath 为 base64
uni.hideLoading();
successFn && successFn(res.tempFilePath);
// that.imagePath = res.tempFilePath;
// that.canvasStatus = true;
}
})
})
},
fail: function(err) {
console.log('image失败', err)
uni.hideLoading();
that.Tips({
title: '无法获取图片信息'
});
src: arr2[0],
success: function(res) {
const WIDTH = res.width;
const HEIGHT = res.height;
// ctx.drawImage(arr2[0], 0, 0, WIDTH, 1050);
ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
ctx.save();
let r = 110;
let d = r * 2;
let cx = 480;
let cy = 790;
ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
// ctx.clip();
ctx.drawImage(arr2[2], cx, cy,d,d);
ctx.restore();
const CONTENT_ROW_LENGTH = 20;
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH);
if (contentRows > 2) {
contentRows = 2;
let textArray = contentArray.slice(0, 2);
textArray[textArray.length - 1] += '……';
contentArray = textArray;
}
ctx.setTextAlign('left');
ctx.setFontSize(36);
ctx.setFillStyle('#000');
// let contentHh = 36 * 1.5;
let contentHh = 36;
for (let m = 0; m < contentArray.length; m++) {
// ctx.fillText(contentArray[m], 50, 1000 + contentHh * m,750);
if (m) {
ctx.fillText(contentArray[m], 50, 1000 + contentHh * m + 18,1100);
} else {
ctx.fillText(contentArray[m], 50, 1000 + contentHh * m,1100);
}
});
}
ctx.setTextAlign('left')
ctx.setFontSize(72);
ctx.setFillStyle('#DA4F2A');
ctx.fillText('¥' + price, 40, 820 + contentHh);
ctx.setTextAlign('left')
ctx.setFontSize(36);
ctx.setFillStyle('#999');
ctx.fillText('¥' + ot_price, 50, 876 + contentHh);
var underline = function(ctx, text, x, y, size, color, thickness ,offset){
var width = ctx.measureText(text).width;
switch(ctx.textAlign){
case "center":
x -= (width/2); break;
case "right":
x -= width; break;
}
y += size+offset;
ctx.beginPath();
ctx.strokeStyle = color;
ctx.lineWidth = thickness;
ctx.moveTo(x,y);
ctx.lineTo(x+width,y);
ctx.stroke();
}
underline(ctx,'¥'+ot_price, 55,865,36,'#999',2,0)
ctx.setTextAlign('left')
ctx.setFontSize(28);
ctx.setFillStyle('#999');
ctx.fillText('长按或扫描查看', 490, 1030 + contentHh);
ctx.draw(true, function() {
uni.canvasToTempFilePath({
canvasId: 'firstCanvas',
fileType: 'png',
destWidth: WIDTH,
destHeight: HEIGHT,
success: function(res) {
uni.hideLoading();
successFn && successFn(res.tempFilePath);
}
})
});
},
fail: function(err) {
console.log('失败',err)
uni.hideLoading();
that.Tips({
title: '无法获取图片信息'
});
}
})
},
/**
* 获取分享海报
* @param array arr2 海报素材
* @param string store_name 素材文字
* @param string price 价格
* @param function successFn 回调函数
*
*
*/
// PosterCanvas: function(arr2, store_name, price, successFn) {
// let that = this;
// uni.showLoading({
// title: '海报生成中',
// mask: true
// });
// const ctx = uni.createCanvasContext('myCanvas');
// ctx.clearRect(0, 0, 0, 0);
// /**
// * 只能获取合法域名下的图片信息,本地调试无法获取
// *
// */
// uni.getImageInfo({
// src: arr2[0],
// success: function(res) {
// const WIDTH = res.width;
// const HEIGHT = res.height;
// ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT);
// ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
// ctx.save();
// let r = 90;
// let d = r * 2;
// let cx = 40;
// let cy = 990;
// ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
// ctx.drawImage(arr2[2], cx, cy,d,d);
// ctx.restore();
// const CONTENT_ROW_LENGTH = 40;
// let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH);
// if (contentRows > 2) {
// contentRows = 2;
// let textArray = contentArray.slice(0, 2);
// textArray[textArray.length - 1] += '……';
// contentArray = textArray;
// }
// ctx.setTextAlign('center');
// ctx.setFontSize(32);
// let contentHh = 32 * 1.3;
// for (let m = 0; m < contentArray.length; m++) {
// ctx.fillText(contentArray[m], WIDTH / 2, 820 + contentHh * m);
// }
// ctx.setTextAlign('center')
// ctx.setFontSize(48);
// ctx.setFillStyle('red');
// ctx.fillText('¥' + price, WIDTH / 2, 880 + contentHh);
// console.log('787878奋斗奋斗');
// console.log(res);
// ctx.draw(true, function() {
// console.log('我在测试');
// console.log(res);
// uni.canvasToTempFilePath({
// canvasId: 'myCanvas',
// fileType: 'png',
// destWidth: WIDTH,
// destHeight: HEIGHT,
// success: function(res) {
// console.log('3333');
// console.log(res);
// uni.hideLoading();
// successFn && successFn(res.tempFilePath);
// }
// })
// });
// },
// fail: function(err) {
// uni.hideLoading();
// that.Tips({
// title: '无法获取图片信息'
// });
// }
// })
// },
/*
* 单图上传
* @param object opt

View File

@ -1,11 +1,11 @@
module.exports = {
productionSourceMap: true, // 生产打包时不输出map文件增加打包速度
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
}
// if (process.env.NODE_ENV === 'production') {
// config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
// config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
// config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
// config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
// }
}
}