diff --git a/api/store.js b/api/store.js index 53fcdcf..40beae6 100644 --- a/api/store.js +++ b/api/store.js @@ -75,8 +75,8 @@ export function getGroomList(type) { /* * 获取商品海报 * */ -export function getProductPoster(id) { - return request.get("/product/poster/" + id, {}, { +export function getProductPoster(id, data) { + return request.get("/product/poster/" + id, data, { login: true }); } diff --git a/components/StorePoster.vue b/components/StorePoster.vue index 4575267..1648e83 100644 --- a/components/StorePoster.vue +++ b/components/StorePoster.vue @@ -29,19 +29,8 @@ 生成图片 --> - - tp + + tp 长按图片可以保存到手机 @@ -49,163 +38,187 @@ diff --git a/config/index.js b/config/index.js index cb07c1d..d55cb76 100644 --- a/config/index.js +++ b/config/index.js @@ -1,11 +1,7 @@ // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'; -<<<<<<< HEAD -export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api'; -======= export const VUE_APP_API_URL = 'http://h5api.xinxintuan.co/api'; ->>>>>>> 2723cab7364b2e3e5d2ec4f2cd941461a936cb95 export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static'; diff --git a/libs/order.js b/libs/order.js index 6e2e024..eb89768 100644 --- a/libs/order.js +++ b/libs/order.js @@ -81,7 +81,7 @@ export async function payOrderHandle(orderId, type, from) { }); payOrder(orderId, type, from) .then(async res => { - await handleOrderPayResults(res.data) + await handleOrderPayResults(res.data, type) resolve() }) .catch(err => { @@ -98,7 +98,9 @@ export async function payOrderHandle(orderId, type, from) { // 处理调用支付接口的逻辑 // @type create(创建订单)||pay(支付订单) -export function handleOrderPayResults(data, type) { +export function handleOrderPayResults(data, type, payType) { + console.log(data, type, payType) + console.log(data, type) return new Promise((resolve, reject) => { uni.hideLoading() @@ -156,19 +158,37 @@ export function handleOrderPayResults(data, type) { weappPay(data.result.jsConfig).finally(() => { resolve() goOrderDetails(data.result.orderId, type) - }); + }).then(res => { + // #ifdef MP-WEIXIN + subscribeMessage() + // #endif + }) break; // APP支付 case "WECHAT_APP_PAY": weappPay(data.result.jsConfig).finally(() => { resolve() goOrderDetails(data.result.orderId, type) - }); + }) break; } }) } +export function subscribeMessage() { + // 调用订阅 + console.log('调用订阅') + uni.requestSubscribeMessage({ + tmplIds: ['W5r2c2kzhbq8uxStkPAVx_sk-5aapMFCqe7b7KU5jXI', '2CB_1UyQrbnlyjJa5syraqJ3cfztPPDOAHe3DEXpMjg', 'vuztugw9VbKbKJDAAVePkjqPpT5mdoREpd4Aq7EGPRU'], + success(res) { + console.log(res) + }, + fail(error){ + console.log(error) + } + }) +} + export function goOrderDetails(id, type) { // 创建订单时跳转到详情 diff --git a/libs/wechat.js b/libs/wechat.js index d3e7b06..da1849a 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -1,3 +1,4 @@ +import { subscribeMessage } from "@/libs/order"; import { getProvider } from "@/utils"; import WechatJSSDK from "wechat-jssdk/dist/client.umd"; import { getWechatConfig, wechatAuth } from "@/api/public"; @@ -9,7 +10,6 @@ import dayjs from "dayjs"; // 支付模块 export const weappPay = (option) => { return new Promise((resolve, reject) => { - console.log(option) if (store.state.$deviceType == 'weixinh5') { setTimeout(() => { location.href = option.mweb_url; @@ -59,11 +59,16 @@ export const weappPay = (option) => { clearTimeout(time) resolve(success) }, 3000) + // #ifdef MP-WEIXIN + subscribeMessage() + // #endif }, fail: (error) => { console.log(error) if (error.errMsg == 'requestPayment:fail cancel') { uni.showToast({ title: '已取消支付', icon: 'none', duration: 5000 }); + } else { + uni.showToast({ title: error || error.msg, icon: 'none', duration: 5000 }); } reject(error) } @@ -344,12 +349,20 @@ export function wxShowLocation() { cancel() { cookie.remove(LATITUDE); cookie.remove(LONGITUDE); - this.$dialog.error("取消获取位置"); + uni.showToast({ + title: "取消获取位置", + icon: "none", + duration: 2000, + }); }, fail() { cookie.remove(LATITUDE); cookie.remove(LONGITUDE); - this.$dialog.error("授权失败"); + uni.showToast({ + title: "授权失败", + icon: "none", + duration: 2000, + }); } }); } diff --git a/pages/activity/Poster/index.vue b/pages/activity/Poster/index.vue index 22a4d49..a199a70 100644 --- a/pages/activity/Poster/index.vue +++ b/pages/activity/Poster/index.vue @@ -9,71 +9,81 @@ diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index 5d09662..dbeeaa0 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -2,24 +2,12 @@ - - + + - + {{ addressInfo.realName }} @@ -35,11 +23,7 @@ -
+
{{ storeItems.name }} @@ -69,10 +53,7 @@ - + 积分抵扣 @@ -124,33 +105,21 @@ 支付方式 - + 微信支付 微信快捷支付 - + 微信支付 微信快捷支付 - + 余额支付 @@ -185,392 +154,396 @@ 立即结算 - - + + diff --git a/pages/shop/StoreList/index.vue b/pages/shop/StoreList/index.vue index fa8d7e8..434a77f 100644 --- a/pages/shop/StoreList/index.vue +++ b/pages/shop/StoreList/index.vue @@ -107,7 +107,11 @@ export default { this.mapKey = res.data.mapKey; }) .catch(err => { - this.$dialog.error(err.msg); + uni.showToast({ + title: err.msg, + icon: "none", + duration: 2000, + }); }); } } diff --git a/pages/user/Recharge/index.vue b/pages/user/Recharge/index.vue index 49cfd1e..f69688c 100644 --- a/pages/user/Recharge/index.vue +++ b/pages/user/Recharge/index.vue @@ -15,23 +15,16 @@ - + {{ item.value.price }} - 赠送:{{ item.value.give_price }} 元 + 赠送:{{ item.value.give_price }} 元