优化功能

This commit is contained in:
weipengfei 2024-05-20 15:43:48 +08:00
parent aad2f02a5d
commit 0b9758ff3b
4 changed files with 642 additions and 597 deletions

View File

@ -3,8 +3,7 @@
<view class="address-popup">
<view class="head-title">提货点</view>
<view class="list-admin">
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword"
@custom="searchKeyword"></up-search>
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword" @custom="searchKeyword"></up-search>
</view>
<scroll-view style="height: 600rpx;padding-bottom: 20rpx;" scroll-y>
<view class="list-li border" v-for="(item,index) in list" :key="index" @click="addressType=item.mer_id">
@ -17,11 +16,14 @@
</view>
</view>
<view class="">
{{item.mer_address||'sdsd'}}
{{item.mer_address||''}}
</view>
<view style="color: #999;">
<text v-if="item.service_phone" @click.stop="callphone(item.service_phone)">{{item.service_user||''}}
{{ item.service_phone||'' }}</text>
</view>
<view class="check">
<image style="width: 36rpx;height: 36rpx" v-if="addressType==item.mer_id"
src="@/static/icon/check.png">
<image style="width: 36rpx;height: 36rpx" v-if="addressType==item.mer_id" src="@/static/icon/check.png">
</image>
<image style="width: 36rpx;height: 36rpx" v-else src="@/static/icon/n-check.png"></image>
</view>
@ -29,15 +31,32 @@
</scroll-view>
<up-button color="#20B128" shape="circle" @click="submitAddress">确认提货点 </up-button>
</view>
<modal title="是否要拨打电话" :content="`即将拨打电话${phone}`" cancleText="取消" confirmText="拨打" :show="callShow" @close="callShow = false"
@change="onCall" />
</up-popup>
</template>
<script setup>
import {
ref
} from "vue"
} from "vue";
import modal from "@/components/modal.vue";
const addressType = ref(-1)
const callShow = ref(false)
const phone = ref('');
const callphone = (e) => {
callShow.value = true;
phone.value = e;
}
const onCall = () => {
uni.makePhoneCall({
phoneNumber: phone.value,
success() {
callShow.value = false
}
})
}
const props = defineProps({
show: {

View File

@ -20,7 +20,7 @@ export function createApp() {
const app = createSSRApp(App)
// 创建Pinia实例 // 将pinia实例挂载到vue实例上
app.use(Pinia.createPinia());
app.use(uviewPlus)
app.use(uviewPlus);
return {
app,
Pinia, // 此处必须将 Pinia 返回

View File

@ -95,16 +95,19 @@
const showOfficial = ref(false);
const navToIndex = () => {
if (!userStore.userInfo.supplier) uni.reLaunch({
if (userStore.userInfo && userStore.token) uni.reLaunch({
url: '/pages/index/index'
})
else if (userStore.userInfo.supplier && !userStore.userInfo.supplier.openid) {
return showOfficial.value = true;
} else {
uni.reLaunch({
url: '/pageQuota/quotation/index'
})
}
// if (!userStore.userInfo.supplier) uni.reLaunch({
// url: '/pages/index/index'
// })
// else if (userStore.userInfo.supplier && !userStore.userInfo.supplier.openid) {
// return showOfficial.value = true;
// } else {
// uni.reLaunch({
// url: '/pageQuota/quotation/index'
// })
// }
}
//

View File

@ -15,19 +15,23 @@
<view v-if="shopInfo.mer_id">
<view>
{{shopInfo.mer_name}}
<span v-if="shopInfo.recommend" style="font-size: 10px;color: #fff;background-color: #20b128;padding: 2rpx 5rpx;border-radius: 4rpx;">推荐</span>
<text v-if="shopInfo.recommend"
style="font-size: 20rpx;color: #fff;background-color: #20b128;padding: 2rpx 5rpx;padding: 1rpx 4rpx;">推荐</text>
</view>
<view>
<view v-if="shopInfo.service_phone" @click="callphone(shopInfo.service_phone)">
<text style="margin-right: 10rpx;">{{shopInfo.service_user}}</text>
<text>{{shopInfo.service_phone}}</text>
<text
style="color: #20b128;margin-left: 10rpx;font-size: 22rpx;">{{shopInfo.distance}}</text>
</view>
<text v-if="shopInfo.distance"
style="color: #20b128;font-size: 22rpx;border: 1px solid #20b128;border-radius: 4rpx;">{{shopInfo.distance}}</text>
</view>
</view>
</view>
</view>
<view class="address-btn">
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle" color="#f6f6f6"
:customStyle="{color:'#666666'}">修改</up-button></view>
</view>
</view>
<view v-if="!addressInfo.address_id" class="m-card row">
@ -47,8 +51,8 @@
</view>
</view>
<view class="address-btn">
<view style="width: 80px;"><up-button @click="showAddress = true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
<view style="width: 80px;"><up-button @click="showAddress = true" size="small" shape="circle" color="#f6f6f6"
:customStyle="{color:'#666666'}">修改</up-button></view>
</view>
</view>
<view class="m-card m-good" v-for="(item,index) in cartList" :key="index">
@ -125,6 +129,8 @@
@change="changeShop" @search="searchShop" />
<modal title="尚未设置收货地址" content="您还没有添加收货地址,请点击添加" cancleText="添加地址" confirmText="继续支付" :show="toastAddressShow"
@close="addAddress" @change="goPay" />
<modal title="是否要拨打电话" :content="`即将拨打电话${phone}`" cancleText="取消" confirmText="拨打" :show="callShow" @close="callShow = false"
@change="onCall" />
</view>
</template>
@ -139,8 +145,8 @@
} from "vue"
import addressPopup from "@/components/addressPopup.vue";
import shopListPopupVue from "@/components/shopListPopup.vue";
import modal from "@/components/modal.vue"
import useCartStore from "@/store/cart.js";
import modal from "@/components/modal.vue";
import {
checkOrderApi
} from "@/api/cart.js";
@ -201,6 +207,7 @@
})
}
//
const shopRef = ref(null);
const shopListShow = ref(false);
@ -252,6 +259,22 @@
getMerchantList(e)
}
//
const callShow = ref(false)
const phone = ref('');
const callphone = (e) => {
callShow.value = true;
phone.value = e;
}
const onCall = () => {
uni.makePhoneCall({
phoneNumber: phone.value,
success() {
callShow.value = false
}
})
}
//
const addAddress = () => {
toastAddressShow.value = false;