diff --git a/api/order.js b/api/order.js index a170677d..b85ca090 100644 --- a/api/order.js +++ b/api/order.js @@ -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); } \ No newline at end of file diff --git a/api/public.js b/api/public.js index 42a6ac65..fd82616c 100644 --- a/api/public.js +++ b/api/public.js @@ -78,3 +78,10 @@ export function copyWords() { return request.get("copy_words", {}, { noAuth: true }); } +/** + * 首页 获取客服地址 + * @returns {*} + */ +export function kefuConfig() { + return request.get("config", {}, { noAuth: true }); +} \ No newline at end of file diff --git a/api/user.js b/api/user.js index 2937d88f..fe38a6da 100644 --- a/api/user.js +++ b/api/user.js @@ -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); } /** diff --git a/components/Authorize002.vue b/components/Authorize002.vue deleted file mode 100644 index 0a85d2a2..00000000 --- a/components/Authorize002.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - - - 授权提醒 - 请授权头像等信息,以便为您提供更好的服务 - - 随便逛逛 - - 去授权 - - - 去授权 - - - - - - - - - - diff --git a/components/couponListWindow/index.vue b/components/couponListWindow/index.vue index 852464f6..8edaf138 100644 --- a/components/couponListWindow/index.vue +++ b/components/couponListWindow/index.vue @@ -9,16 +9,17 @@ 满{{item.minPrice}}元可用 - - 通用劵 - 品类券 - 商品券 + + 通用 + 品类 + 商品 {{item.name}} - {{ item.receiveStartTime ? item.receiveStartTime + " ~ " : ""}}{{ item.receiveEndTime }} - {{item.use_title || '已领取'}} - {{coupon.statusTile || '立即领取'}} + 领取后{{item.day}}天内可用 + {{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}} + {{item.use_title || '已领取'}} + {{coupon.statusTile || '立即领取'}} diff --git a/components/couponListWindow/备份.vue b/components/couponListWindow/备份.vue deleted file mode 100644 index 23359206..00000000 --- a/components/couponListWindow/备份.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - 优惠券 - - - - - ¥{{ item.coupon_price }} - - 满{{ item.use_min_price }}元可用 - - - - 通用劵 - 品类券 - 商品券 - {{ item.title }} - - - {{ item.start_time ? item.start_time + "-" : ""}}{{ item.end_time }} - - - - - - - - - - - - - - - - - - - diff --git a/components/couponWindow/index.vue b/components/couponWindow/index.vue index b22660c0..b0428035 100644 --- a/components/couponWindow/index.vue +++ b/components/couponWindow/index.vue @@ -6,7 +6,8 @@ ¥{{item.money}} 购物买{{item.minPrice}}减{{item.money}} - {{item.receiveStartTime ? item.receiveStartTime+'~' : ''}}{{item.receiveEndTime}} + 领取后{{item.day}}天内可用 + {{item.useStartTimeStr&&item.useEndTimeStr ? item.useStartTimeStr+'~'+item.useEndTimeStr : ''}} diff --git a/components/payment/index.vue b/components/payment/index.vue index 7167e20d..36628ec3 100644 --- a/components/payment/index.vue +++ b/components/payment/index.vue @@ -25,7 +25,8 @@ - - diff --git a/pages/goods_details/index003.vue b/pages/goods_details/index003.vue deleted file mode 100644 index 1feb4e6c..00000000 --- a/pages/goods_details/index003.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - 点击 - - - - - \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 4c92ab01..7eb9e5d3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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) { diff --git a/pages/news_details/index.vue b/pages/news_details/index.vue index b89c77c3..2def71a4 100644 --- a/pages/news_details/index.vue +++ b/pages/news_details/index.vue @@ -5,7 +5,7 @@ {{articleInfo.categoryName}} {{articleInfo.createTime}} - + {{articleInfo.visit}} @@ -140,7 +140,7 @@ } - diff --git a/pages/users/user_payment/index.vue b/pages/users/user_payment/index.vue index ce859812..dda23ae5 100644 --- a/pages/users/user_payment/index.vue +++ b/pages/users/user_payment/index.vue @@ -12,16 +12,15 @@ {{item}} - {{ item.price }} 元 赠送:{{ item.giveMoney }} 元 - - + + 注意事项: @@ -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; diff --git a/pages/users/user_return_list/index.vue b/pages/users/user_return_list/index.vue index 42a0ccf1..a0e93697 100644 --- a/pages/users/user_return_list/index.vue +++ b/pages/users/user_return_list/index.vue @@ -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 ? "我也是有底线的" : '加载更多'; diff --git a/pages/users/user_spread_code/index.vue b/pages/users/user_spread_code/index.vue index 01fc85c5..8a7bac06 100644 --- a/pages/users/user_spread_code/index.vue +++ b/pages/users/user_spread_code/index.vue @@ -1,5 +1,5 @@ - + @@ -23,9 +23,9 @@ - + - + @@ -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 @@