|
@@ -26,12 +26,12 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="login-contont-button">
|
|
<view class="login-contont-button">
|
|
|
- <button class="btn" @click="Pay">立即支付</button>
|
|
|
|
|
|
|
+ <button class="btn" @tap="Pay">立即支付</button>
|
|
|
|
|
|
|
|
<view style="padding: 0 30rpx">
|
|
<view style="padding: 0 30rpx">
|
|
|
<view class="cell-item">
|
|
<view class="cell-item">
|
|
|
<u-cell-group :border="false">
|
|
<u-cell-group :border="false">
|
|
|
- <u-cell title="代金券折扣" :border="false" isLink @click="voucher">
|
|
|
|
|
|
|
+ <u-cell title="代金券折扣" :border="false" isLink @tap="voucher">
|
|
|
<template slot="value">
|
|
<template slot="value">
|
|
|
<text style="color: orange;">{{ CellText }}</text>
|
|
<text style="color: orange;">{{ CellText }}</text>
|
|
|
</template>
|
|
</template>
|
|
@@ -70,7 +70,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="footer">
|
|
<view class="footer">
|
|
|
- <u-button type="primary" class="btn" text="确定" @click="submitOk"></u-button>
|
|
|
|
|
|
|
+ <u-button type="primary" class="btn" text="确定" @tap="submitOk"></u-button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</u-popup>
|
|
</u-popup>
|
|
@@ -79,14 +79,14 @@
|
|
|
<view class="coupon-popup">
|
|
<view class="coupon-popup">
|
|
|
<view class="popup-header">
|
|
<view class="popup-header">
|
|
|
<text class="title">店铺代金券</text>
|
|
<text class="title">店铺代金券</text>
|
|
|
- <u-icon name="close" size="22" @click="showPopup = false" />
|
|
|
|
|
|
|
+ <u-icon name="close" size="22" @tap="showPopup = false" />
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="coupon-list">
|
|
<view class="coupon-list">
|
|
|
<u-radio-group v-model="voucherRadio" placement="column" @change="groupChange" iconSize="30"
|
|
<u-radio-group v-model="voucherRadio" placement="column" @change="groupChange" iconSize="30"
|
|
|
size="40">
|
|
size="40">
|
|
|
<view class="coupon-item" :class="item.status === 0 ? 'disabled' : 'active'"
|
|
<view class="coupon-item" :class="item.status === 0 ? 'disabled' : 'active'"
|
|
|
- v-for="(item, index) in couponList" :key="index" @click="selectCoupon(index)">
|
|
|
|
|
|
|
+ v-for="(item, index) in couponList" :key="index" @tap="selectCoupon(index)">
|
|
|
<view class="left">
|
|
<view class="left">
|
|
|
<view class="tag" :class="item.voucherType === 1 ? 'independent' : 'chain'">
|
|
<view class="tag" :class="item.voucherType === 1 ? 'independent' : 'chain'">
|
|
|
{{ item.voucherType === 1 ? '独立券' : item.voucherType === 2 ? '连锁券' : '联合券' }}
|
|
{{ item.voucherType === 1 ? '独立券' : item.voucherType === 2 ? '连锁券' : '联合券' }}
|
|
@@ -139,84 +139,7 @@ export default {
|
|
|
shopInfo: {},
|
|
shopInfo: {},
|
|
|
zfbInfo: {},
|
|
zfbInfo: {},
|
|
|
localUserInfo: null,
|
|
localUserInfo: null,
|
|
|
- couponList: [
|
|
|
|
|
- {
|
|
|
|
|
- "amount": 2,
|
|
|
|
|
- "applyAllProducts": 1,
|
|
|
|
|
- "applyProductIds": [],
|
|
|
|
|
- "bizType": 14,
|
|
|
|
|
- "claimTime": "2026-04-11 09:56:51",
|
|
|
|
|
- "createTime": "2026-04-11 09:56:51",
|
|
|
|
|
- "discountAmount": null,
|
|
|
|
|
- "endTime": "2026-04-30 10:33:38",
|
|
|
|
|
- "id": "2042783907267350530",
|
|
|
|
|
- "isApply": 0,
|
|
|
|
|
- "minOrderAmount": null,
|
|
|
|
|
- "orderNo": "",
|
|
|
|
|
- "productIds": [],
|
|
|
|
|
- "ruleDisplay": "无门槛",
|
|
|
|
|
- "startTime": "2026-04-10 10:33:26",
|
|
|
|
|
- "status": 1,
|
|
|
|
|
- "storeCount": 1,
|
|
|
|
|
- "storeId": "2018881434293329922",
|
|
|
|
|
- "storeList": [
|
|
|
|
|
- {
|
|
|
|
|
- "isCreator": 1,
|
|
|
|
|
- "storeId": "2018881434293329922",
|
|
|
|
|
- "storeName": "医药one店",
|
|
|
|
|
- "voucherId": "2042068417733718017"
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "storeName": "",
|
|
|
|
|
- "unApplyReason": "",
|
|
|
|
|
- "updateTime": "2026-04-11 09:56:47",
|
|
|
|
|
- "useTime": null,
|
|
|
|
|
- "userId": "1965353825816576001",
|
|
|
|
|
- "voucherId": "2042068417733718017",
|
|
|
|
|
- "voucherName": "2元代金券",
|
|
|
|
|
- "voucherRule": 1,
|
|
|
|
|
- "voucherType": 3,
|
|
|
|
|
- "voucherTypeDesc": "联合券"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "amount": 2,
|
|
|
|
|
- "applyAllProducts": 1,
|
|
|
|
|
- "applyProductIds": [],
|
|
|
|
|
- "bizType": 14,
|
|
|
|
|
- "claimTime": "2026-04-11 09:56:50",
|
|
|
|
|
- "createTime": "2026-04-11 09:56:50",
|
|
|
|
|
- "discountAmount": null,
|
|
|
|
|
- "endTime": "2026-04-16 21:21:31",
|
|
|
|
|
- "id": "2042783902674587650",
|
|
|
|
|
- "isApply": 0,
|
|
|
|
|
- "minOrderAmount": null,
|
|
|
|
|
- "orderNo": "",
|
|
|
|
|
- "productIds": [],
|
|
|
|
|
- "ruleDisplay": "无门槛",
|
|
|
|
|
- "startTime": "2026-04-07 15:14:37",
|
|
|
|
|
- "status": 1,
|
|
|
|
|
- "storeCount": 1,
|
|
|
|
|
- "storeId": "2018881434293329922",
|
|
|
|
|
- "storeList": [
|
|
|
|
|
- {
|
|
|
|
|
- "isCreator": 1,
|
|
|
|
|
- "storeId": "2018881434293329922",
|
|
|
|
|
- "storeName": "医药one店",
|
|
|
|
|
- "voucherId": "2042139544933875713"
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "storeName": "",
|
|
|
|
|
- "unApplyReason": "",
|
|
|
|
|
- "updateTime": "2026-04-11 09:56:46",
|
|
|
|
|
- "useTime": null,
|
|
|
|
|
- "userId": "1965353825816576001",
|
|
|
|
|
- "voucherId": "2042139544933875713",
|
|
|
|
|
- "voucherName": "联合券",
|
|
|
|
|
- "voucherRule": 1,
|
|
|
|
|
- "voucherType": 3,
|
|
|
|
|
- "voucherTypeDesc": "联合券"
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ couponList: [],
|
|
|
couponId: "",
|
|
couponId: "",
|
|
|
CellText: "暂无代金券",
|
|
CellText: "暂无代金券",
|
|
|
payment: "",
|
|
payment: "",
|
|
@@ -229,7 +152,7 @@ export default {
|
|
|
this.shopId = options.shopId || "";
|
|
this.shopId = options.shopId || "";
|
|
|
this.storeId = options.storeId || "";
|
|
this.storeId = options.storeId || "";
|
|
|
// 读取本地支付宝用户信息
|
|
// 读取本地支付宝用户信息
|
|
|
- let info = localStorage.getItem("aliPayUserInfo");
|
|
|
|
|
|
|
+ let info = uni.getStorageSync("aliPayUserInfo");
|
|
|
if (info) {
|
|
if (info) {
|
|
|
this.localUserInfo = JSON.parse(info);
|
|
this.localUserInfo = JSON.parse(info);
|
|
|
}
|
|
}
|
|
@@ -312,7 +235,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 支付宝授权登录
|
|
// 支付宝授权登录
|
|
|
- async getInfo() {
|
|
|
|
|
|
|
+ getInfo() {
|
|
|
uni.showLoading({ title: "登录中..." });
|
|
uni.showLoading({ title: "登录中..." });
|
|
|
api.weChatH5Login({
|
|
api.weChatH5Login({
|
|
|
code: this.zfbInfo.auth_code,
|
|
code: this.zfbInfo.auth_code,
|
|
@@ -321,8 +244,10 @@ export default {
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.userInfo = res.data;
|
|
this.userInfo = res.data;
|
|
|
- localStorage.setItem("token", this.userInfo.access_token);
|
|
|
|
|
- localStorage.setItem("aliPayUserInfo", JSON.stringify(this.userInfo));
|
|
|
|
|
|
|
+ uni.setStorageSync("token", this.userInfo.access_token)
|
|
|
|
|
+ uni.setStorageSync("aliPayUserInfo", JSON.stringify(this.userInfo))
|
|
|
|
|
+ // localStorage.setItem("token", this.userInfo.access_token);
|
|
|
|
|
+ // localStorage.setItem("aliPayUserInfo", JSON.stringify(this.userInfo));
|
|
|
this.getShopInfo();
|
|
this.getShopInfo();
|
|
|
this.getVoucher();
|
|
this.getVoucher();
|
|
|
this.getPhoneBind();
|
|
this.getPhoneBind();
|
|
@@ -338,7 +263,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 支付
|
|
// 支付
|
|
|
- async Pay() {
|
|
|
|
|
|
|
+ Pay() {
|
|
|
if (!this.price || Number(this.price) <= 0) {
|
|
if (!this.price || Number(this.price) <= 0) {
|
|
|
return uni.$u.toast("请输入支付金额");
|
|
return uni.$u.toast("请输入支付金额");
|
|
|
}
|
|
}
|
|
@@ -368,7 +293,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取店铺信息
|
|
// 获取店铺信息
|
|
|
- async getShopInfo() {
|
|
|
|
|
|
|
+ getShopInfo() {
|
|
|
if (!this.shopId) return;
|
|
if (!this.shopId) return;
|
|
|
api.getStoreInfoByScan({
|
|
api.getStoreInfoByScan({
|
|
|
shopId: this.shopId,
|
|
shopId: this.shopId,
|
|
@@ -389,41 +314,54 @@ export default {
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.userInfo = res.data;
|
|
this.userInfo = res.data;
|
|
|
- localStorage.setItem("token", this.userInfo.access_token);
|
|
|
|
|
- localStorage.setItem("aliPayUserInfo", JSON.stringify(this.userInfo));
|
|
|
|
|
|
|
+ uni.setStorageSync("token", this.userInfo.access_token)
|
|
|
|
|
+ uni.setStorageSync("aliPayUserInfo", JSON.stringify(this.userInfo));
|
|
|
this.getPhoneBind()
|
|
this.getPhoneBind()
|
|
|
}
|
|
}
|
|
|
- }).catch((err) => {
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- // 绑定手机号提交
|
|
|
|
|
- async submitOk() {
|
|
|
|
|
|
|
+ // 绑定手机号提交(支付宝浏览器完美修复版)
|
|
|
|
|
+ submitOk() {
|
|
|
|
|
+ // 防重复提交
|
|
|
|
|
+ if (this.isSubmitting) return;
|
|
|
|
|
+ this.isSubmitting = true;
|
|
|
|
|
+
|
|
|
if (!this.phone) return uni.$u.toast("请输入手机号");
|
|
if (!this.phone) return uni.$u.toast("请输入手机号");
|
|
|
if (!this.yzm) return uni.$u.toast("请输入验证码");
|
|
if (!this.yzm) return uni.$u.toast("请输入验证码");
|
|
|
- uni.showLoading({ title: "正在绑定中..." });
|
|
|
|
|
- api.bindH5Phone({
|
|
|
|
|
- mobile: this.phone,
|
|
|
|
|
- code: this.yzm,
|
|
|
|
|
- password: 123456,
|
|
|
|
|
- confirmPassword: 123456,
|
|
|
|
|
- type: 0,
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- uni.$u.toast("绑定成功");
|
|
|
|
|
- this.showPhone = false;
|
|
|
|
|
- this.restLogin()
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 支付宝浏览器核心修复:延迟请求
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.showLoading({ title: "正在绑定中..." });
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ mobile: this.phone,
|
|
|
|
|
+ code: this.yzm,
|
|
|
|
|
+ password: "123456",
|
|
|
|
|
+ confirmPassword: "123456",
|
|
|
|
|
+ type: 0,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ api.bindH5Phone(params).then((res) => {
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
- } else {
|
|
|
|
|
- uni.$u.toast(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- }).catch((err) => {
|
|
|
|
|
- uni.$u.toast(err.data.msg);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.isSubmitting = false;
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.$u.toast("绑定成功");
|
|
|
|
|
+ this.showPhone = false;
|
|
|
|
|
+ this.restLogin();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.$u.toast(res.msg || "绑定失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ this.isSubmitting = false;
|
|
|
|
|
+ console.error("绑定错误:", err);
|
|
|
|
|
+ uni.$u.toast("绑定失败,请重试");
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 200);
|
|
|
},
|
|
},
|
|
|
codeChange(text) {
|
|
codeChange(text) {
|
|
|
this.tips = text;
|
|
this.tips = text;
|
|
|
},
|
|
},
|
|
|
- // 获取验证码
|
|
|
|
|
|
|
+ // 获取验证码(支付宝终极修复版)
|
|
|
async getCode() {
|
|
async getCode() {
|
|
|
if (!this.$refs.uCode.canGetCode) return;
|
|
if (!this.$refs.uCode.canGetCode) return;
|
|
|
if (!this.phone) return uni.$u.toast("请输入手机号");
|
|
if (!this.phone) return uni.$u.toast("请输入手机号");
|
|
@@ -434,12 +372,13 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
uni.$u.toast(res.msg || "发送失败");
|
|
uni.$u.toast(res.msg || "发送失败");
|
|
|
}
|
|
}
|
|
|
- }).catch(() => {
|
|
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ alert(JSON.stringify(err));
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
uni.$u.toast("发送失败");
|
|
uni.$u.toast("发送失败");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|