This commit is contained in:
zmj 2024-06-27 17:39:25 +08:00
parent b1b3f659b5
commit db89348f2a
8 changed files with 110 additions and 60 deletions

View File

@ -43,7 +43,7 @@
<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,10 @@
},
})
const valChange = () => {
console.log(4545)
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>
@ -27,6 +26,7 @@
<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="">
@ -61,7 +61,7 @@
suffixIcon='arrow-down'></up-input>
</view>
</up-form-item>
<up-form-item label="" v-if='Role == 1'>
<!-- <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="{
@ -69,7 +69,7 @@
'border-radius': '30rpx'
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
</view>
</up-form-item>
</up-form-item> -->
<up-form-item label="">
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
<view class="">
@ -83,16 +83,24 @@
<text @click="getCode" class='btn-text' v-else> {{ flag ? '获取验证码' : '重新获取' }} </text>
</view>
</up-form-item>
<!-- <view style="font-size: 40rpx;" v-if="Role==1">
¥500.00
</view> -->
</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="请输入金额" 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
@ -125,7 +133,7 @@
</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"
@ -226,14 +234,15 @@
import Push from "@/utils/push.js"
import {
onPullDownRefresh,
onLoad
onLoad,
onReachBottom
} from "@dcloudio/uni-app"
import {
config
} from "@/config/app.js"
const showPop1 = ref(false)
const Role = ref('')
const Role = ref(1)
const range = ref({})
const columns = ref([])
const showModa = ref(true)
@ -320,6 +329,7 @@
address: "",
label_name: "",
label_id: "",
label_limit: "",
user_ship: '',
code: '',
brigade: "",
@ -339,6 +349,11 @@
// user_ship: '1',
// code: ''
})
const tofixedPrice = () => {
formData.price = (+formData.price).toFixed(2)
}
const resetFormData = () => {
for (let key in formData) {
formData[key] = ''
@ -354,8 +369,8 @@
const conformRole = (e) => {
formData.label_name = e.value[0].label_name
formData.label_id = e.value[0].label_id
console.log(e)
formData.price = (+e.value[0].limit).toFixed(2)
formData.label_limit = e.value[0].limit
showPop1.value = false
}
@ -480,13 +495,15 @@
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
if (!formData.code) 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'
// formData.user_ship = 1
// vipRechargeApi(formData).then(res => {})
// return
if (!formData.label_id) return uni.$u.toast('请选择用户身份');
uni.scanCode({
success: function(res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
@ -505,17 +522,6 @@
}
});
} else {
delete formData.recharge_type
delete formData.auth_code
formData.user_ship = 4
vipRechargeApi(formData).then(res => {
uni.$u.toast('操作成功');
currentTab.value = 2
resetFormData()
getLists()
getCount()
})
}
}
@ -557,6 +563,12 @@
}
//
let where = {
page_no: 1,
page_size: 25,
loadingOver: false
}
const count = ref(0)
const getCount = async () => {
if (Role.value == 4) return;
@ -569,19 +581,16 @@
//
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
}
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
}
@ -622,6 +631,32 @@
uni.stopPullDownRefresh()
}, 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'>
@ -751,7 +786,7 @@
}
.slot-content {
padding-bottom: 50rpx;
/* padding-bottom: 50rpx; */
}
.code-btn {

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

@ -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,8 +212,7 @@
<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 ">
@ -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;
})
@ -694,7 +699,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

@ -81,7 +81,7 @@
const type = ref(1) // 1 2
const onKetDown = (e) => {
uni.vibrateShort();
uni.vibrateLong();
if (type.value == 1) {
form.password.length < 6 ?
form.password += e :

View File

@ -79,13 +79,13 @@
</view>
<view class="m-card order-remark">
<view style="display: flex;align-items: center;">
<!-- <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> -->
<view class="head-title" style="margin-top: 20rpx;">
<text>订单备注</text>
<text>{{formData.remark.length}}/140</text>
@ -110,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;" />
@ -127,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>

View File

@ -43,7 +43,7 @@
}
break;
}
uni.vibrateShort();
uni.vibrateLong();
if (refValue.value.length === props.num) {
emits('complete', refValue.value.join(''));
}