完善小程序
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<view class="containertopboxitemleft_one"
|
||||
:class="fromInfo.status != 0?'':'containertopboxitemleft_ones'">
|
||||
<block v-if="item.type == 2">
|
||||
<text>{{item.num || 0}}</text>
|
||||
<text>1</text>
|
||||
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
|
||||
@@ -181,9 +181,8 @@
|
||||
url: uni.conf.baseUrl + '/account/user/common/upload',
|
||||
filePath: avatarUrl,
|
||||
header: {
|
||||
environment: 'app',
|
||||
type: 'android',
|
||||
version: '1.7.3',
|
||||
shopId: uni.cache.get('shopId'),
|
||||
token: uni.cache.get('token') || '',
|
||||
'content-type': 'multipart/form-data'
|
||||
},
|
||||
fileType: 'image',
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<view class="gift_list">
|
||||
<view class="gift_list_item" v-for="(item,index) in infoForn.couponList" :key="index">
|
||||
<text class="icon"></text>
|
||||
<text class="text"> {{ item.title }} </text>
|
||||
<text class="text"> {{ item.title }} * {{ item.number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -29,17 +29,17 @@
|
||||
<view class="card_cen">
|
||||
<view class="card_cen_left">{{ shopUserInfo.shopInfo.isVip == 0 ? '尚未开通会员暂无法享受会员权益' : '欢迎加入本店会员~'}}
|
||||
</view>
|
||||
<view class="card_cen_right" v-if="shopUserInfo.shopInfo.isVip != 0">查看特权</view>
|
||||
<!-- <view class="card_cen_right" v-if="shopUserInfo.shopInfo.isVip != 0">查看特权</view> -->
|
||||
</view>
|
||||
<view class="card_bom" v-if="shopUserInfo.shopInfo.isVip != 0">
|
||||
<view class="card_bom_item" @click="itemClick(1)">
|
||||
<text>{{shopUserInfo.shopInfo.amount || '0.00'}}</text><text>储值</text>
|
||||
<text>{{shopUserInfo.amount || '0.00'}}</text><text>储值</text>
|
||||
</view>
|
||||
<view class="card_bom_item" @click="itemClick(2)">
|
||||
<text>{{shopUserInfo.shopInfo.accountPoints || '0'}}</text><text>积分</text>
|
||||
<text>{{shopUserInfo.accountPoints || '0'}}</text><text>积分</text>
|
||||
</view>
|
||||
<view class="card_bom_item" @click="itemClick(3)">
|
||||
<text>{{shopUserInfo.shopInfo.couponNum || '0'}}</text><text>优惠券</text>
|
||||
<text>{{shopUserInfo.couponNum || '0'}}</text><text>优惠券</text>
|
||||
</view>
|
||||
<view class="card_bom_item">
|
||||
<text>0</text><text>权益卡</text>
|
||||
@@ -159,6 +159,7 @@
|
||||
let res = await APIshopUserInfo({
|
||||
shopId: shopUserInfo.shopId
|
||||
})
|
||||
Object.assign(shopUserInfo, res);
|
||||
uni.cache.set('orderVIP', res)
|
||||
uni.cache.set('ordershopUserInfo', res.shopInfo)
|
||||
form.memberOpen = res.isVip == 1 ? false : true
|
||||
@@ -188,7 +189,6 @@
|
||||
// 根据传的shopInfo来返回上面的值
|
||||
// shopUserInfo.shopExtend = res.shopExtend.member_bg
|
||||
asyncshopUserInfo()
|
||||
console.log(shopUserInfo.shopId)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
const formInfo = reactive({
|
||||
shopInfo: '',
|
||||
shopInfo:uni.cache.get('orderVIP'),
|
||||
url: '',
|
||||
shopId: ''
|
||||
})
|
||||
@@ -51,47 +51,46 @@
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面参数
|
||||
const pageParams = currentPage.options;
|
||||
formInfo.shopInfo = JSON.parse(decodeURIComponent(pageParams.shopInfo))
|
||||
// formInfo.shopInfo = JSON.parse(decodeURIComponent(pageParams.shopInfo))
|
||||
formInfo.shopId = pageParams.shopId
|
||||
let res = await APIshopUsercode({
|
||||
shopId: pageParams.shopId
|
||||
})
|
||||
console.log(formInfo.shopInfo)
|
||||
if (res) {
|
||||
formInfo.url = res;
|
||||
try {
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery();
|
||||
query.select('#barcodeCanvas')
|
||||
.fields({
|
||||
node: true,
|
||||
size: true
|
||||
})
|
||||
.exec((res) => {
|
||||
if (res[0]) {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const dpr = uni.getSystemInfoSync().pixelRatio;
|
||||
canvas.width = res[0].width * dpr;
|
||||
canvas.height = res[0].height * dpr;
|
||||
ctx.scale(dpr, dpr);
|
||||
// nextTick(() => {
|
||||
// const query = uni.createSelectorQuery();
|
||||
// query.select('#barcodeCanvas')
|
||||
// .fields({
|
||||
// node: true,
|
||||
// size: true
|
||||
// })
|
||||
// .exec((res) => {
|
||||
// if (res[0]) {
|
||||
// const canvas = res[0].node;
|
||||
// const ctx = canvas.getContext('2d');
|
||||
// const dpr = uni.getSystemInfoSync().pixelRatio;
|
||||
// canvas.width = res[0].width * dpr;
|
||||
// canvas.height = res[0].height * dpr;
|
||||
// ctx.scale(dpr, dpr);
|
||||
|
||||
JsBarcode(canvas, formInfo.url, {
|
||||
width: 2,
|
||||
height: 100,
|
||||
displayValue: true,
|
||||
fontOptions: 'bold',
|
||||
font: 'monospace',
|
||||
textAlign: 'center',
|
||||
textPosition: 'bottom',
|
||||
textMargin: 2,
|
||||
fontSize: 20,
|
||||
background: '#ffffff',
|
||||
lineColor: '#000000'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
// JsBarcode(canvas, formInfo.url, {
|
||||
// width: 2,
|
||||
// height: 100,
|
||||
// displayValue: true,
|
||||
// fontOptions: 'bold',
|
||||
// font: 'monospace',
|
||||
// textAlign: 'center',
|
||||
// textPosition: 'bottom',
|
||||
// textMargin: 2,
|
||||
// fontSize: 20,
|
||||
// background: '#ffffff',
|
||||
// lineColor: '#000000'
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<template>
|
||||
<view class="Box">
|
||||
<view class="box_box">
|
||||
<view class="box_item flex-between">
|
||||
<!-- <view class="box_item flex-between">
|
||||
<text class="top_box_one_text">当前账号</text>
|
||||
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
||||
<button v-if="!form.mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||
<view class="text">获取手机号</view>
|
||||
</button>
|
||||
</view> -->
|
||||
<view class="box_item flex-between">
|
||||
<text class="top_box_one_text">当前账号</text>
|
||||
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" :disabled="true" />
|
||||
|
||||
</view>
|
||||
<view class="box_item flex-between" style="position:relative;">
|
||||
@@ -45,13 +49,25 @@
|
||||
onMounted
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
APIuserpwd,
|
||||
APIusercode
|
||||
} from '@/common/api/api.js'
|
||||
import {
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
|
||||
import {
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
const storeuser = productStore();
|
||||
const shopUserInfo = reactive({
|
||||
shopInfo: "",
|
||||
shopInfo: uni.cache.get('orderVIP'),
|
||||
shopId: ''
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
mobile: '',
|
||||
mobile: uni.cache.get('orderVIP').phone,
|
||||
password: '',
|
||||
payPassword: '',
|
||||
checkCode: ''
|
||||
@@ -65,11 +81,10 @@
|
||||
second: 60,
|
||||
showText: true,
|
||||
Recapture: '获取验证码',
|
||||
shopUserInfo: null,
|
||||
})
|
||||
|
||||
const CodeRegister = async () => {
|
||||
const res = await this.api.phoneValidateCode({
|
||||
const res = await APIusercode({
|
||||
// post 手机验证码
|
||||
phone: form.mobile
|
||||
});
|
||||
@@ -167,30 +182,15 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
let res = await this.api.loginresetPwd({
|
||||
vipId: this.shopUserInfo.id,
|
||||
pwd: this.form.password,
|
||||
code: this.form.checkCode
|
||||
let res = await APIuserpwd({
|
||||
checkPayPwd: form.payPassword,
|
||||
payPwd: form.password,
|
||||
code: form.checkCode
|
||||
})
|
||||
|
||||
if (res.code == 0) {
|
||||
if (datalist.isPwd != 0) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '设置成功',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
// 获取用户信息
|
||||
this.loginwxuserInfo()
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
// * 获取会员信息
|
||||
await storeuser.actionsproductqueryProduct()
|
||||
if (res) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,8 +201,16 @@
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面参数
|
||||
const options = currentPage.options;
|
||||
shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||
console.log(shopUserInfo)
|
||||
// if (options.shopId) {
|
||||
// let res = await APIshopUserInfo({F
|
||||
// shopId: options.shopId
|
||||
// })
|
||||
// uni.cache.set('shopId', options.shopId, 30)
|
||||
// uni.cache.set('orderVIP', res)
|
||||
// uni.cache.set('ordershopUserInfo', res.shopInfo)
|
||||
// } else {
|
||||
// shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||
// }
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="my_item my_assets">
|
||||
<view class="my_item my_assets" @click="Myassets">
|
||||
<view class="my_item_title">我的资产</view>
|
||||
<view class="my_assets_list">
|
||||
<view class="my_list_item">
|
||||
@@ -32,14 +32,14 @@
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png">
|
||||
</image>
|
||||
<view class="my_list_item_name">积分</view>
|
||||
<view class="my_list_item_num">{{userInfo.couponNum ||'0'}}</view>
|
||||
<view class="my_list_item_num">{{userInfo.accountPoints ||'0'}}</view>
|
||||
</view>
|
||||
<view class="my_list_item">
|
||||
<image class="my_list_item_icon"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/coupon.png">
|
||||
</image>
|
||||
<view class="my_list_item_name">优惠券</view>
|
||||
<view class="my_list_item_num">{{userInfo.points ||'0'}}</view>
|
||||
<view class="my_list_item_num">{{userInfo.couponNum ||'0'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -107,7 +107,7 @@
|
||||
const teblist = ref([])
|
||||
const shopExtend = ref(null)
|
||||
const userInfo = reactive({})
|
||||
|
||||
|
||||
const ShopId = ref(uni.cache.get('shopId'))
|
||||
|
||||
const clickEvent = () => {
|
||||
@@ -129,6 +129,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 我的资产
|
||||
const Myassets = () => {
|
||||
uni.pro.navigateTo('user/member/memberdetails', {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index'
|
||||
})
|
||||
}
|
||||
|
||||
const clickTo = (item, index) => {
|
||||
let shopId = null;
|
||||
switch (item.type) {
|
||||
|
||||
Reference in New Issue
Block a user