Compare commits

...

13 Commits

Author SHA1 Message Date
zmj be3213996f add 2024-06-27 21:43:40 +08:00
zmj d5b7abbdf6 add 2024-06-27 21:16:36 +08:00
zmj 3ecad90fd6 add 2024-06-27 20:15:39 +08:00
zmj ab6162d558 add 2024-06-27 18:27:31 +08:00
zmj e1a23da1d0 add 2024-06-27 17:59:54 +08:00
zmj e24c3094c3 add 2024-06-27 17:49:50 +08:00
zmj db89348f2a add 2024-06-27 17:39:25 +08:00
zmj b1b3f659b5 add 2024-06-27 14:00:57 +08:00
zmj f71924219f add 2024-06-27 11:23:39 +08:00
zmj 25c609e39a add 2024-06-27 10:49:56 +08:00
zmj fe5fc9ec35 ad 2024-06-27 10:35:45 +08:00
zmj e7aefe8bff add 2024-06-27 10:34:22 +08:00
zmj 0f86686f8b add 2024-06-27 09:16:38 +08:00
11 changed files with 843 additions and 621 deletions

View File

@ -146,3 +146,7 @@ export const getloginSms = (data) => {
export const getReportingSms = (data) => {
return request.post('/user/user/reporting_sms', data);
}
export const uploadImg = (data) => {
return request.post('/Upload/image', data);
}

View File

@ -5,14 +5,14 @@
<view class="content-modal">系统检测到您未绑定手机号, 为方便您继续使用, 请绑定手机号码</view>
<view class="btn-box-modal">
<view style="width: 130rpx;"><up-button @click="close" plain color="#999">取消绑定</up-button></view>
<view style="width: 350rpx;"><up-button @getphonenumber="change" open-type="getPhoneNumber" color="#20B128">立即绑定</up-button></view>
<view style="width: 350rpx;"><up-button @getphonenumber="change" open-type="getPhoneNumber"
color="#20B128">立即绑定</up-button></view>
</view>
</view>
</up-popup>
</template>
<script setup>
const props = defineProps({
show: {
type: Boolean,
@ -25,27 +25,29 @@
emit('close');
}
const change = (e)=>{
const change = (e) => {
emit('change', e);
}
</script>
<style scoped lang="scss">
.m-modal-popup{
.m-modal-popup {
width: 500rpx;
padding: 40rpx;
.head-title-modal{
.head-title-modal {
font-size: 32rpx;
text-align: center;
}
.content-modal{
.content-modal {
font-size: 26rpx;
color: #999;
text-align: center;
padding: 40rpx 0;
}
.btn-box-modal{
.btn-box-modal {
display: flex;
justify-content: space-between;
}

View File

@ -37,13 +37,13 @@
<view v-if="datas.is_bulk" class="row" style="height: 100rpx;">
<view>购买重量<text style="color: #F55726;">*</text></view>
<view style="justify-content: end;">
<up-number-box v-model="datas.cart_num"></up-number-box>
<up-number-box v-model="datas.cart_num" @change="valChange"></up-number-box>
</view>
</view>
<view v-else class="row" style="height: 100rpx;">
<view>购买数量<text style="color: #F55726;">*</text></view>
<view style="justify-content: end;">
<up-number-box v-model="datas.cart_num"></up-number-box>
<up-number-box v-model="datas.cart_num" @change="valChange"></up-number-box>
</view>
</view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
@ -80,6 +80,9 @@
},
})
const valChange = () => {
uni.vibrateShort();
}
let priceKey = ref({})
if (uni.getStorageSync('PRICE_KEY')) {

View File

@ -4,17 +4,22 @@ import store from "@/store/user.js"
// 环境
// let env = "dev"
let env = "prod"
// let env = "liu";
// let env = "release";
// let env = "local";
switch (env) {
case 'dev':
BASE_URL = 'https://test-multi-store.lihaink.cn';
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
break;
case 'liu':
case 'release':
BASE_URL = 'https://ceshi-multi-store.lihaink.cn';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
case 'local':
BASE_URL = 'http://192.168.1.201:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
default:
BASE_URL = 'https://multi-store.lihaink.cn';
WSS_URL = 'wss://multi-store.lihaink.cn/pull'

View File

@ -1,15 +1,14 @@
<template>
<view class="" v-if="!STORE_INFO.id">
<up-modal :show="showModa" title="门店信息" @confirm="confirmStore" confirmColor='#20B128'>
<up-modal :show="showModa" title="登录门店" @confirm="confirmStore" confirmColor='#20B128'>
<view class="slot-content">
<up-form labelPosition="left" label-width="100rpx">
<up-form-item label="手机号" borderBottom>
<up-input v-model="storePhone" placeholder="请输入门店手机号"></up-input>
</up-form-item>
<up-form-item label="角色" borderBottom>
<!-- <up-form-item label="角色" borderBottom>
<uni-data-select v-model="Role" :localdata="range" :clear='false'></uni-data-select>
</up-form-item>
</up-form-item> -->
</up-form>
</view>
</up-modal>
@ -17,7 +16,8 @@
<view v-else>
<view class="tabs">
<text @click="currentTab = 1" :class="{ actText: currentTab == 1 }">开通{{ Role == 1 ? '行业会员' : '商户' }} </text>
<text @click="currentTab = 1" :class="{ actText: currentTab == 1 }">开通{{ Role == 1 ? '行业会员' : '商户' }}
</text>
<text @click="currentTab = 2, getCount(), getLists()" :class="{ actText: currentTab == 2 }"> 已开通列表</text>
<view class="lines" :class="{ actLine: currentTab == 2 }" />
</view>
@ -26,29 +26,31 @@
<view class="card card1">
<view class="card1-tit">
{{ Role == 1 ? '行业会员' : '商户' }}开通报备
<!-- <up-input v-model='formData.auth_code'> </up-input> -->
</view>
<up-form labelPosition="left" :model="formData" :borderBottom='false'>
<up-form-item label="">
<up-input v-model="formData.real_name" border="none" prefixIcon="account" placeholder="请输入真实姓名"
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
:placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
:placeholderStyle="{ color: '#444444' }"
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
</up-form-item>
<up-form-item label="">
<up-input v-model="formData.mobile" border="none" prefixIcon="phone" placeholder="请输入电话号码"
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
:placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
:placeholderStyle="{ color: '#444444' }"
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
</up-form-item>
<up-form-item label="">
<view @click="showPop = true" style="width: 100%;">
<up-input style="pointer-events: none" v-model="formData.address" border="none" prefixIcon="map"
readonly placeholder="点击选择地址" :customStyle="{
<up-input style="pointer-events: none" v-model="formData.address" border="none"
prefixIcon="map" readonly placeholder="点击选择地址" :customStyle="{
background: '#F3F3F3', padding: '20rpx',
'border-radius': '30rpx'
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"
suffixIcon='arrow-down'></up-input>
</view>
</up-form-item>
<up-form-item label="" v-if='Role == 1'>
<view @click="showPop1 = true" style="width: 100%;">
<up-input style="pointer-events: none" v-model="formData.label_name" border="none"
@ -59,6 +61,15 @@
suffixIcon='arrow-down'></up-input>
</view>
</up-form-item>
<!-- <up-form-item label="" v-if='Role == 1'>
<view style="width: 100%;">
<up-input v-model="formData.price" border="none" prefixIcon="rmb-circle" placeholder="请输入金额"
:customStyle="{
background: '#F3F3F3', padding: '20rpx',
'border-radius': '30rpx'
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
</view>
</up-form-item> -->
<up-form-item label="">
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
<view class="">
@ -68,17 +79,28 @@
'border-radius': '30rpx'
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
</view>
<text class='btn-text' style="color: grey;" v-if='cutDown'>重新获取({{ cutDown }})</text>
<text @click="getCode" class='btn-text' v-else> {{ flag ? '获取验证码' : '重新获取' }} </text>
</view>
</up-form-item>
</up-form>
<view class="store-info">
报备人:{{ STORE_INFO.name }}
</view>
<view class="store-info" v-if="Role==1">
<view class="" style="width: 300rpx;margin: 0 auto;border-bottom: 1px solid #F3F3F3;">
<up-input inputAlign='center' placeholder="请输入金额" @focus="formData.price=''" color='#FF6B00'
:placeholderStyle="{fontSize:'28rpx'}" fontSize='20px' border="none"
v-model="formData.price" @blur='tofixedPrice'></up-input>
</view>
<view style="color: red;margin-top: 20rpx;font-size: 24rpx;"
v-if="formData.label_limit&&formData.price<formData.label_limit">
{{formData.label_name}}角色最低金额不能低于{{formData.label_limit}}
</view>
</view>
</view>
<view class="submit-btn" @click="submit">
<view
@ -111,10 +133,11 @@
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item, index) in lists" :key="item.order_id">
<uni-td align="center">{{ index + 1 }}</uni-td>
<uni-td align="center">{{index+1}}</uni-td>
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 1'>{{ item.real_name }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 1'>{{ item.price }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 4'>{{ item.create_time }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center"
v-if='Role == 4'>{{ item.create_time }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 4'>{{ item.nickname }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 1'>{{ item.label_name }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">
@ -142,8 +165,8 @@
:activeStyle="{ color: '#20B128' }"></up-tabs>
<up-line style="margin-top:20rpx "></up-line>
<view class="address-content" v-if='currentAddressIndex == 0'>
<view class="address-li" :class='{ act: item.city_code == formData.city }' v-for="item in addressList.city"
:key="item.city_code" @click="addressLiClick(0, item)">
<view class="address-li" :class='{ act: item.city_code == formData.city }'
v-for="item in addressList.city" :key="item.city_code" @click="addressLiClick(0, item)">
<text>{{ item.city_name }}</text>
<up-icon name="arrow-right" :color="item.city_code == formData.city ? '#20B128' : '#777777'" />
</view>
@ -166,36 +189,37 @@
<view class="address-li" v-for="item in addressList.village" @click="addressLiClick(3, item)"
:key="item.village_code" :class='{ act: item.village_code == formData.village }'>
<text>{{ item.village_name }}</text>
<up-icon name="arrow-right" :color="item.village_code == formData.village ? '#20B128' : '#777777'" />
<up-icon name="arrow-right"
:color="item.village_code == formData.village ? '#20B128' : '#777777'" />
</view>
</view>
<view class="address-content" v-else-if='currentAddressIndex == 4'>
<view class="address-li" :class='{ act: item.id == formData.brigade }' v-for="item in addressList.brigade"
:key="item.id" @click="addressLiClick(4, item)">
<view class="address-li" :class='{ act: item.id == formData.brigade }'
v-for="item in addressList.brigade" :key="item.id" @click="addressLiClick(4, item)">
<text>{{ item.brigade_name }}</text>
<up-icon name="arrow-right" :color="item.id == formData.brigade ? '#20B128' : '#777777'" />
</view>
</view>
</view>
</up-popup>
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1 = false' @close="showPop1 = false"
@open="showPop1 = true" keyName='label_name' confirmColor='#33B83A'></up-picker>
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1 = false'
@close="showPop1 = false" @open="showPop1 = true" keyName='label_name' confirmColor='#33B83A'></up-picker>
</template>
<script setup>
import {
import {
reactive,
ref
} from 'vue';
import useUserStore from "@/store/user";
import {
} from 'vue';
import useUserStore from "@/store/user";
import {
provinceListApi,
cityListApi,
areaListApi,
streetListApi,
villageListApi,
brigadeListApi
} from "@/api/address.js"
import {
} from "@/api/address.js"
import {
vipRechargeApi,
rechargeCountApi,
reVipRechargeApi,
@ -206,23 +230,24 @@ import {
getUserShip,
getCreateLists,
getReportingSms
} from "@/api/user.js"
import Push from "@/utils/push.js"
import {
} from "@/api/user.js"
import Push from "@/utils/push.js"
import {
onPullDownRefresh,
onLoad
} from "@dcloudio/uni-app"
import {
onLoad,
onReachBottom
} from "@dcloudio/uni-app"
import {
config
} from "@/config/app.js"
} from "@/config/app.js"
const showPop1 = ref(false)
const Role = ref('')
const range = ref({})
const columns = ref([])
const showModa = ref(true)
const storePhone = ref('')
const confirmStore = () => {
const showPop1 = ref(false)
const Role = ref(1)
const range = ref({})
const columns = ref([])
const showModa = ref(true)
const storePhone = ref('')
const confirmStore = () => {
getStoreByPhone({
phone: storePhone.value
}).then(res => {
@ -233,15 +258,15 @@ const confirmStore = () => {
}).catch(err => {
uni.$u.toast('未查到店铺信息,请检查手机号码')
})
}
//
let STORE_INFO = reactive({
}
//
let STORE_INFO = reactive({
id: ""
})
})
//
const setPhoneOneDay = () => {
//
const setPhoneOneDay = () => {
if (uni.getStorageSync('VIP_PHONE')) return;
const currentDate = new Date();
const nextDay = new Date(currentDate);
@ -250,8 +275,8 @@ const setPhoneOneDay = () => {
time: nextDay,
phone: storePhone.value
}));
}
const getPhoneOneDay = () => {
}
const getPhoneOneDay = () => {
if (uni.getStorageSync('VIP_PHONE')) {
let data = JSON.parse(uni.getStorageSync('VIP_PHONE'))
if (new Date() > data.time) {
@ -260,19 +285,19 @@ const getPhoneOneDay = () => {
storePhone.value = data.phone
}
}
}
//
}
//
//
const cutDown = ref(0)
const flag = ref(true)
const code = ref('')
const checkPhone = (phone) => {
//
const cutDown = ref(0)
const flag = ref(true)
const code = ref('')
const checkPhone = (phone) => {
const regex = /^1[3-9]\d{9}$/;
return regex.test(formData.mobile) ? true : false
}
}
const getCode = async () => {
const getCode = async () => {
if (!checkPhone(formData.mobile)) return uni.$u.toast('请输入正确的手机号')
await getReportingSms({
account: formData.mobile
@ -281,13 +306,17 @@ const getCode = async () => {
cutDown.value = 60
let timer = setInterval(() => {
cutDown.value--
if (cutDown.value <= 0) clearInterval(timer)
if (cutDown.value <= 0) {
cutDown.value = 0;
clearInterval(timer);
}
}, 1000)
}
//
}
//
const currentTab = ref(1)
const formData = reactive({
const currentTab = ref(1)
const formData = reactive({
store_id: STORE_INFO.id,
mobile: "",
province: 510000,
@ -300,9 +329,11 @@ const formData = reactive({
address: "",
label_name: "",
label_id: "",
label_limit: "",
user_ship: '',
code: '',
brigade: "",
price: "",
// store_id: STORE_INFO.id,
// mobile: "19130550023",
// province: 510000,
@ -317,36 +348,54 @@ const formData = reactive({
// label_id: "4",
// user_ship: '1',
// code: ''
})
})
const conformRole = (e) => {
const tofixedPrice = () => {
formData.price = (+formData.price).toFixed(2)
}
const resetFormData = () => {
for (let key in formData) {
formData[key] = ''
}
tabsList.forEach(item => {
item.name = '请选择'
})
formData.province = 510000
cutDown.value = 0
currentAddressIndex.value = 0
}
const conformRole = (e) => {
formData.label_name = e.value[0].label_name
formData.label_id = e.value[0].label_id
formData.price = (+e.value[0].limit).toFixed(2)
formData.label_limit = e.value[0].limit
showPop1.value = false
}
}
//
const showPop = ref(false)
const currentAddressIndex = ref(0)
const currentAddressList = () => {
//
const showPop = ref(false)
const currentAddressIndex = ref(0)
const currentAddressList = () => {
if (!formData.city) return [0, 'city'];
else if (formData.area) return [1, 'area'];
else if (formData.street) return [2, 'street'];
else if (formData.village) return [3, 'village'];
else if (formData.brigade) return [4, 'brigade'];
}
const addressTbasChange = (e) => {
}
const addressTbasChange = (e) => {
currentAddressIndex.value = e.index
}
const addressList = reactive({
}
const addressList = reactive({
city: [],
area: [],
street: [],
village: [],
brigade: []
})
const addressLiClick = async (i, item) => {
})
const addressLiClick = async (i, item) => {
if (i == 0) {
formData.city = item.city_code
tabsList[0].name = item.city_name
@ -391,15 +440,14 @@ const addressLiClick = async (i, item) => {
formData.address = tabsList[0].name + tabsList[1].name + tabsList[2].name + tabsList[3].name + tabsList[4]
.name
return currentAddressIndex.value++
}
const getCityList = async () => {
}
const getCityList = async () => {
let res = await cityListApi({
province_code: formData.province
})
addressList.city = res.data
}
getCityList()
const tabsList = reactive(
}
const tabsList = reactive(
[{
name: "请选择"
},
@ -423,29 +471,32 @@ const tabsList = reactive(
//
// scoket
let timerInvol = null
const userInfo = useUserStore().userInfo;
const connection = new Push({
let timerInvol = null
// scoket
const userInfo = useUserStore().userInfo;
const connection = new Push({
url: config.WSS_URL, // websocket
app_key: '2ce3ce22329517213caa7dad261f5695',
});
// user-1
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
user_channel.on('message', function (data) {
});
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
user_channel.on('message', function(data) {
try {
clearTimeout(timerInvol);
paySuccessToTabs2()
} catch (error) { }
});
const submit = async () => {
} catch (error) {}
});
//
//
const submit = async () => {
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
if (!formData.code) return uni.$u.toast('请输入短信验证码');
if (!formData.label_id) return uni.$u.toast('请选择用户身份');
if (!formData.address) return uni.$u.toast('请选择地址');
if (!formData.label_id) return uni.$u.toast('请选择用户身份');
if (formData.price < formData.label_limit) return uni.$u.toast(
`${formData.label_name}角色最低金额不能低于${formData.label_limit}`);
formData.store_id = STORE_INFO.id
if (Role.value == 1) {
// formData.recharge_type = 'INDUSTRYMEMBERS'
@ -453,7 +504,7 @@ const submit = async () => {
// vipRechargeApi(formData).then(res => {})
// return
uni.scanCode({
success: function (res) {
success: function(res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
uni.showLoading({
title: '支付中...'
@ -464,46 +515,22 @@ const submit = async () => {
vipRechargeApi(formData).then(res => {
timerInvol = setTimeout(() => {
uni.hideLoading();
if (currentTab.value == 2) return;
uni.$u.toast('支付超时');
}, 30000)
})
}
});
} else {
delete formData.recharge_type
delete formData.auth_code
formData.user_ship = 4
vipRechargeApi(formData).then(res => {
uni.$u.toast('操作成功');
currentTab.value = 2
formData.real_name = ''
formData.mobile = ''
formData.address = ''
formData.label_name = ''
formData.city = ''
formData.area = ''
formData.street = ''
formData.village = ''
formData.brigade = ''
formData.code = ''
currentAddressIndex.value = 0
cutDown.value = 0
tabsList.forEach(item => {
item.name = '请选择'
})
getLists()
getCount()
})
}
}
}
const rePay = (item) => {
const rePay = (item) => {
uni.scanCode({
success: function (res) {
success: function(res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
uni.showLoading({
title: '支付中...'
title: '等待用户支付'
});
reVipRechargeApi({
id: item.id,
@ -511,78 +538,67 @@ const rePay = (item) => {
}).then(res => {
timerInvol = setTimeout(() => {
uni.hideLoading();
if (currentTab.value == 2) return;
uni.$u.toast('支付超时');
}, 30000)
})
}
});
}
}
// formDatatabs2
const paySuccessToTabs2 = () => {
// formDatatabs2
const paySuccessToTabs2 = () => {
uni.hideLoading()
uni.showToast({
title: '支付成功',
duration: 2000,
success() {
currentTab.value = 2
formData.real_name = ''
formData.mobile = ''
formData.address = ''
formData.label_name = ''
formData.city = ''
formData.area = ''
formData.street = ''
formData.village = ''
formData.brigade = ''
formData.code = ''
currentAddressIndex.value = 0
cutDown.value = 0
tabsList.forEach(item => {
item.name = '请选择'
})
resetFormData()
setTimeout(() => {
getLists()
getCount()
}, 500); // 1
}
});
}
}
//
const count = ref(0)
const getCount = async () => {
//
let where = {
page_no: 1,
page_size: 25,
loadingOver: false
}
const count = ref(0)
const getCount = async () => {
if (Role.value == 4) return;
let res = await rechargeCountApi({
store_id: STORE_INFO.id
})
count.value = res.data.count
}
//
const lists = ref([])
const getLists = async () => {
if (Role.value == 1) {
let res = await rechargeListsApi({
store_id: STORE_INFO.id,
recharge_type: "INDUSTRYMEMBERS"
})
lists.value = res.data.lists
} else {
let res = await getCreateLists({
store_id: STORE_INFO.id,
})
lists.value = res.data.lists
count.value = res.data.count
}
}
//
const lists = ref([])
const getLists = async () => {
where.loadingOver = false
where.page_no = 1
where.page_size = 25
let res = await rechargeListsApi({
store_id: STORE_INFO.id,
recharge_type: "INDUSTRYMEMBERS",
page_no: 1,
page_size: 25
})
lists.value = res.data.lists
getCount()
getLists()
}
getCount()
getLists()
const upadtaStatus = (item) => {
const upadtaStatus = (item) => {
updataOrderApi({
order_no: item.order_id,
recharge: 1
@ -591,9 +607,9 @@ const upadtaStatus = (item) => {
getLists()
})
}
}
onLoad(() => {
onLoad(() => {
getUserShip().then(res => {
range.value = res.data.lists.map(item => {
return {
@ -606,19 +622,46 @@ onLoad(() => {
columns.value = [res.data.lists]
})
getPhoneOneDay()
})
getCityList()
})
onPullDownRefresh(() => {
onPullDownRefresh(() => {
getCount()
getLists()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 500)
})
}, 1000)
})
onReachBottom(async () => {
if (where.loadingOver) return;
where.page_no++;
if (Role.value == 1) {
let res = await rechargeListsApi({
store_id: STORE_INFO.id,
recharge_type: "INDUSTRYMEMBERS",
...where
})
if (res.data.lists.length <= 0) {
return where.loadingOver = true
}
lists.value.push(...res.data.lists)
} else {
let res = await getCreateLists({
store_id: STORE_INFO.id,
...where
})
if (res.data.lists.length <= 0) {
return where.loadingOver = true
}
lists.value.push(...res.data.lists)
}
})
</script>
<style lang='scss'>
.tabs {
.tabs {
background-color: #fff;
width: 100vw;
box-sizing: border-box;
@ -648,17 +691,17 @@ onPullDownRefresh(() => {
.actLine {
left: calc(75vw - 35rpx);
}
}
}
.card {
.card {
width: 710rpx;
margin: 20rpx auto;
background-color: #fff;
box-sizing: border-box;
border-radius: 10rpx;
}
}
.card1 {
.card1 {
padding: 52rpx 30rpx;
.card1-tit {
@ -674,9 +717,9 @@ onPullDownRefresh(() => {
text-align: center;
margin-top: 30rpx;
}
}
}
.submit-btn {
.submit-btn {
/* height: 200rpx; */
position: fixed;
bottom: 50rpx;
@ -684,10 +727,10 @@ onPullDownRefresh(() => {
left: 50%;
transform: translateX(-50%);
}
}
.vip-card {
.vip-card {
width: 690rpx;
height: 270rpx;
background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/4a92b202406162207212332.png');
@ -706,17 +749,17 @@ onPullDownRefresh(() => {
color: #7B5232;
}
}
}
.table {
.table {
width: 710rpx;
box-sizing: border-box;
font-size: 30rpx;
margin: 0 auto;
}
}
.address-content {
.address-content {
padding: 20rpx;
height: 50vh;
overflow-y: auto;
@ -733,26 +776,26 @@ onPullDownRefresh(() => {
.act {
color: #20B128;
}
}
}
.uni-table-th {
.uni-table-th {
padding: 10rpx 0 !important;
}
}
.uni-table-td {
.uni-table-td {
padding: 10rpx 0 !important;
}
}
.slot-content {
padding-bottom: 50rpx;
}
.slot-content {
/* padding-bottom: 50rpx; */
}
.code-btn {
.code-btn {
display: flex;
align-items: center;
}
}
.btn-text {
.btn-text {
color: #20B128;
}
}
</style>

View File

@ -19,7 +19,7 @@
<view class="page-box1">
<view class="total" @click='isAdmin=!isAdmin'>
<view>共计<text style="color: #20B128;">{{cartList.length}}</text></view>
<view v-if="!isAdmin">管理</view>
<view v-if="!isAdmin">删除商品</view>
<view v-else>完成</view>
</view>
<view v-if="cartList.length>0" class="list">

View File

@ -58,7 +58,7 @@
<text>个人中心</text>
</view>
</view>
<view class='headScoll' ref='headscroll' :style="{ height: isScroll ? '0' : '200rpx' }">
<view class='headScoll' ref='headscroll' :style="{ height: isScroll ? '0' : '170rpx' }">
<scroll-view class="head-view" scroll-x @scrolltolower="getgoodClassList(0)">
<view class="list">
<view class="item" :class="{ 'item-active': topActive === item.id }"
@ -167,7 +167,7 @@
</view>
<view class="tag">
<view class="icon" />
赠10%品牌礼品
赠10%品牌礼品
</view>
</view>
<view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
@ -212,16 +212,15 @@
<view class="price-info">
<view class="row">
<view>合计</view>
<view class="price" v-if='cartInfo.pay_price<=0||userStore?.userInfo?.user_ship !=4'>¥<text
style="font-size: 36rpx;">{{ cartInfo.pay_price }}</text></view>
<view class="price">¥<text style="font-size: 36rpx;">{{ cartInfo.pay_price }}</text></view>
</view>
<view style="font-size: 22rpx;text-indent: 3em;color: #F55726;"
v-if="cartInfo.msg&&cartInfo.total_price>0 ">
<view style="font-size: 22rpx;color: #F55726;padding-left: 60rpx;"
v-if="cartInfo.msg&&cartInfo.total_price>0">
{{cartInfo.msg }}
</view>
</view>
<view class="btn">
<up-button color="#20b128" :disabled="cartInfo.pay_price<=0" @click="settleAccounts"> 结算</up-button>
<up-button color="#20b128" :disabled="cartInfo.pay_price<=0" @click="settleAccounts"> 支付</up-button>
</view>
<view class="cart" @click="navTo(`/pages/cart/cart`)">
<image src="@/static/icon/cart.png"></image>
@ -238,11 +237,11 @@
温馨提示
</view>
<view class="rect-contetn">
只需再购买 {{500- cartInfo.pay_price}} 就能拥有10%的品牌礼品券若错过此次机会则无礼品券
只需再凑满 {{500- cartInfo.pay_price}} 即可享受采购金额10%的品牌礼品兑换券错过此次机会则无礼品券
</view>
<view class="rect-btn">
<view style="width: 236rpx;">
<up-button @click="abandActive">放弃优惠</up-button>
<up-button @click="abandActive">放弃礼品券</up-button>
</view>
<view style="width: 236rpx;">
<up-button color="#20b128" @click="showOverlay=false">继续采购</up-button>
@ -364,6 +363,8 @@
const show = ref(0);
const topActive = ref(0);
const changeOne = async (item, index) => {
where.value.top_cate_id = item.id
delete where.value.two_cate_id // id, , id,
topActive.value = item.id;
show.value = 0;
goodClassTow.value = item?.children || [];
@ -376,6 +377,8 @@
const leftActive = ref(0);
const changeTwo = (item, index) => {
console.log(item)
where.value.two_cate_id = item.id
isScroll.value = false;
getWXDom(instance)
leftActive.value = item.id;
@ -457,17 +460,19 @@
if (class_all) class_id = ""; //
if (loadmore) where.value.page_no++;
else where.value.page_no = 1;
goodListApi({
let data = {
...where.value,
class_all: class_all,
class: class_id,
cate_id: class_id,
}).then(res => {
// top_cate_id: "",
// two_cate_id: ""
}
goodListApi(data).then(res => {
for (let key in res.data.extend) {
priceKey[key] = res.data.extend[key]
}
uni.setStorageSync("PRICE_KEY", JSON.stringify(priceKey))
console.log(priceKey)
if (loadmore) goodList.value.push(...res.data.lists);
else goodList.value = res.data.lists;
})
@ -581,6 +586,9 @@
}
}
})
if (!url) return;
uni.navigateTo({
url: url
})
@ -591,6 +599,8 @@
const goodRef = ref(null);
const goodData = ref({});
const openGoodPopup = (item) => { // /
navTo(false)
if (!userStore.token || !userStore.userInfo.mobile) return;
goodData.value = item;
goodRef.value.setData(item);
showGoodPopup.value = true;
@ -694,7 +704,6 @@
}
// id
if (opt.id && opt.id != 'undefined') {
console.log(opt.id, opt.id != 'undefined', "进来了这里")
where.value.store_id = opt.id;
const info = await shopDetailApi({
store_id: where.value.store_id

View File

@ -16,10 +16,10 @@
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon name="weixin-fill"
color="#fff" size="28"></up-icon></up-button>
</view>
<view class="btn">
<!-- <view class="btn">
<up-button @click="navgo('/pages/login/test')" color="#20B128" size="large"><up-icon
name="account-fill" color="#fff" size="28"></up-icon></up-button>
</view>
</view> -->
<!-- <view class="btn">
<up-button @click="officialCode" color="#20B128" size="large"><up-icon name="weixin-fill" color="#fff"
size="28"></up-icon></up-button>

View File

@ -1,7 +1,7 @@
<style lang="scss">
.rest {
display: flex;
justify-content: space-between;
justify-content: space-around;
margin: 20rpx;
.rest-item {
@ -20,6 +20,20 @@
}
}
}
.balance {
position: absolute;
top: 160rpx;
z-index: 999;
left: 80rpx;
font-size: 50rpx;
display: flex;
align-items: center;
width: 620rpx;
justify-content: space-between;
}
</style>
<template>
<view>
@ -29,7 +43,7 @@
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
mode="widthFix"></image>
<view class="u-card">
<view style="display: flex;">
<view style="display: flex;" @click="updataInfp">
<up-avatar :src="userInfo.avatar" size="56"></up-avatar>
<view class="content">
<view class="u-phone">{{userInfo.nickname}}</view>
@ -42,32 +56,37 @@
</view>
</view>
<view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
<view class="" style="font-size: 28rpx;transform: translateY(10rpx);">
余额:
</view>
<view class="">
{{userInfo.now_money||"0.00"}}<text style="font-size: 28rpx;"> ()</text>
</view>
</view>
<view class="rest">
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
<view class="rest-item-num">{{userInfo.now_money||"0.00"}}</view>
<view class="rest-item-txt">余额</view>
</view>
</view> -->
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=1')">
<view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view>
<view class="rest-item-txt">采购款</view>
</view>
<view class="rest-item">
<view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view>
<!-- <view class="rest-item-num">{{"10000.00"}}</view> -->
<view class="rest-item-txt">返还金</view>
</view>
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
<view class="rest-item">
<view class="rest-item-num">{{userInfo.number ||"0.00"}}</view>
<view class="rest-item-txt">冻结礼品券</view>
</view>
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
<view class="rest-item">
<view class="rest-item-num">{{userInfo.GetNumber ||"0.00"}}</view>
<view class="rest-item-txt">可用礼品券</view>
<view class="rest-item-txt">礼品券</view>
</view>
<view class="rest-item">
<view class="rest-item-num">{{userInfo.number ||"0.00"}}</view>
<view class="rest-item-txt">冻结券</view>
</view>
</view>
<view class="order-info-box">
@ -120,10 +139,38 @@
</up-cell-group>
</view>
</view>
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true">
<view class="popContent">
<view style="text-align: center;font-size: 30rpx;font-weight: bold;">
修改个人信息
</view>
<up-form labelPosition="left">
<up-form-item label="呢称" prop="userInfo.name" borderBottom ref="item1">
<up-input v-model="formData.nick_name" border="none" placeholder="请输入个人呢称"></up-input>
</up-form-item>
<up-form-item label="头像" prop="userInfo.sex" borderBottom ref="item1">
<up-image :src="formData.avatar" width="80px" height="80px" @click="uploadAvatar"></up-image>
</up-form-item>
</up-form>
<view style="display: flex;margin-top: 40rpx;justify-content: space-around;">
<view style="width: 200rpx;">
<up-button color="#20b128" @click="updataFn">保存</up-button>
</view>
<view style="width: 200rpx;">
<up-button @click="showPop=false">取消</up-button>
</view>
</view>
<!-- <button></button> -->
</view>
</up-popup>
</template>
<script setup>
import {
reactive,
ref
} from "vue";
import useUserStore from "@/store/user";
@ -135,13 +182,18 @@
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
userInfoApi
userInfoApi,
uploadImg,
loginUpdateUserApi
} from "@/api/user.js"
import {
config
} from "@/config/app.js"
const userStore = useUserStore();
const userInfo = ref({});
let token = uni.getStorageSync('token') || ''
const orderCount = ref({
no_pay: 0,
receiving: 0,
@ -178,6 +230,58 @@
}
const showPop = ref(false)
const updataInfp = () => {
console.log(5454)
showPop.value = true
}
const formData = reactive({
nick_name: "",
avatar: ""
})
const updataFn = () => {
loginUpdateUserApi({
nickname: formData.nick_name,
avatar: formData.avatar
}).then(res => {
uni.$u.toast('修改成功');
showPop.value = false
userInfoApi().then(res => {
userInfo.value = res.data;
})
})
}
const uploadAvatar = () => {
uni.chooseImage({
success: (chooseImageRes) => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
uni.uploadFile({
url: config.HTTP_REQUEST_URL + '/api/Upload/image', //
filePath: tempFilePaths[0],
name: 'file',
header: {
token: token,
},
success: (uploadFileRes) => {
let data = JSON.parse(uploadFileRes.data)
formData.avatar = data.data.uri
uni.hideLoading()
}
});
}
});
}
const logout = () => {
userStore.setToken('');
userStore.setUserInfo({});
@ -191,6 +295,9 @@
onShow(() => {
userInfoApi().then(res => {
userInfo.value = res.data;
formData.avatar = res.data.avatar
formData.nick_name = res.data.nickname
})
getOrderCount();
})
@ -222,7 +329,7 @@
box-sizing: border-box;
padding: 50rpx 0 50rpx 50rpx;
position: absolute;
top: 50rpx;
top: -10rpx;
left: 0;
z-index: 2;
display: flex;
@ -407,6 +514,9 @@
overflow: hidden;
}
.popContent {
padding: 30rpx 20rpx 50rpx 20rpx;
}
.gift {
width: 710rpx;

View File

@ -113,6 +113,8 @@
</view>
</view>
</view>
<ZyPasswordboard v-if='passwordBoardVisible' v-model:visible="passwordBoardVisible" v-bind="passwordBoardProps"
@close='closeKeyBord' />
</template>
<script setup>
@ -127,6 +129,7 @@
import good from "./component/good.vue";
import orderCanclePopup from "@/components/orderCanclePopup.vue"
import modal from "@/components/modal.vue"
import ZyPasswordboard from '@/uni_modules/zy-passwordboard/components/zy-passwordboard/zy-passwordboard.vue';
import {
cancelOrderApi,
rePaymentApi,
@ -134,6 +137,11 @@
orderListApi,
purchaseAgainApi
} from "@/api/order.js"
import {
userInfoApi
} from "@/api/user.js"
const tabsActive = ref(0)
const changeTab = ({
@ -284,7 +292,35 @@
}
}
const rePay = (e) => {
const pay_type = ref('3')
const rePay = async (e) => {
payFn(e)
return
if (!pay_type.value) return uni.$u.toast('请选择支付方式');
if (pay_type.value == 3 || pay_type.value == 18) {
let res = await userInfoApi()
return res.data.pay_password ? passwordBoardVisible.value = true : showModal.value = true
}
}
//
const password = ref(''); //
const passwordBoardVisible = ref(false);
const passwordBoardProps = {
title: '输入支付密码',
onComplete(value) {
password.value = value
passwordBoardVisible.value = false
console.log(password.value)
// payFn()
}
};
const closeKeyBord = () => {
password.value = ''
}
const payFn = (e) => {
rePaymentApi({
order_id: e.id,
address_id: e.address_id,
@ -317,6 +353,11 @@
})
}
const notWxPay = () => {
alert("不是微信支付")
}
//
const where = ref([{
page_no: 1,

View File

@ -79,9 +79,16 @@
</view>
<view class="m-card order-remark">
<view class="head-title">
<!-- <view style="display: flex;align-items: center;">
<text style="margin-right: 20rpx;">是否存货</text>
<up-radio-group v-model="isCh" placement="row">
<up-radio activeColor="#20b128" label="是" name="1" style="margin-right: 10rpx;"></up-radio>
<up-radio activeColor="#20b128" label="否" name="0"></up-radio>
</up-radio-group>
</view> -->
<view class="head-title" style="margin-top: 20rpx;">
<text>订单备注</text>
<text>0/200</text>
<text>{{formData.remark.length}}/140</text>
</view>
<up-textarea style="background-color: #F6F6F6;" v-model="formData.remark" placeholder="暂无备注内容"
:height="40"></up-textarea>
@ -103,8 +110,9 @@
</view>
</view>
<view class="row"
v-if="userInfo.user_ship == 4 || userInfo.user_ship == 5 || userInfo.user_ship == 6 || userInfo.user_ship == 1">
<!-- <view class="row"
v-if="userInfo.user_ship == 4 || userInfo.user_ship == 5 || userInfo.user_ship == 6 || userInfo.user_ship == 1"> -->
<view class="row">
<!-- <view class="row"> -->
<view class="icon-text">
<image src="@/static/icon/YEZF.png" style="width:40rpx;height: 40rpx;" />
@ -120,7 +128,8 @@
</view>
</view>
<view class="row" v-if="userInfo.user_ship == 1">
<!-- <view class="row" v-if="userInfo.user_ship == 1"> -->
<view class="row">
<view class="icon-text">
<image src="@/static/icon/cgkzf.png" style="width:40rpx;height: 40rpx;" />
<text style="margin-left: 20rpx;font-size: 26rpx;">采购款支付</text>
@ -140,7 +149,7 @@
<view class="submit-row">
<view class="tips">
<view style="margin-right: 20rpx;"> {{ cartList.length }} </view>
<view style="margin-right: 20rpx;transform: translateY(5rpx);"> {{ cartList.length }} </view>
<view class="all">
<text style="color: #000;">合计: </text>
<text></text>
@ -152,8 +161,7 @@
</view>
</view>
<view style="width: 200rpx;">
<up-button color="#20B128" shape="circle" @click="submitOrder"
:throttleTime="1000">预付款提交</up-button>
<up-button color="#20B128" shape="circle" @click="submitOrder" :throttleTime="1000">支付</up-button>
</view>
</view>
@ -208,6 +216,7 @@
const cartStore = useCartStore();
const reservation_time = ref('')
const isCh = ref(0)
const formData = ref({
remark: ""
@ -371,11 +380,6 @@
const passwordBoardProps = {
title: '输入支付密码',
onComplete(value) {
// uni.vibrateShort({
// success: function() {
// console.log('success');
// }
// });
password.value = value
passwordBoardVisible.value = false
payFn()
@ -554,6 +558,7 @@
justify-content: space-between;
font-size: 24rpx;
margin-top: 10rpx;
align-items: center;
}
.time {