优化功能

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="address-popup">
<view class="head-title">提货点</view> <view class="head-title">提货点</view>
<view class="list-admin"> <view class="list-admin">
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword" <up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword" @custom="searchKeyword"></up-search>
@custom="searchKeyword"></up-search>
</view> </view>
<scroll-view style="height: 600rpx;padding-bottom: 20rpx;" scroll-y> <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"> <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> </view>
<view class=""> <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>
<view class="check"> <view class="check">
<image style="width: 36rpx;height: 36rpx" v-if="addressType==item.mer_id" <image style="width: 36rpx;height: 36rpx" v-if="addressType==item.mer_id" src="@/static/icon/check.png">
src="@/static/icon/check.png">
</image> </image>
<image style="width: 36rpx;height: 36rpx" v-else src="@/static/icon/n-check.png"></image> <image style="width: 36rpx;height: 36rpx" v-else src="@/static/icon/n-check.png"></image>
</view> </view>
@ -29,15 +31,32 @@
</scroll-view> </scroll-view>
<up-button color="#20B128" shape="circle" @click="submitAddress">确认提货点 </up-button> <up-button color="#20B128" shape="circle" @click="submitAddress">确认提货点 </up-button>
</view> </view>
<modal title="是否要拨打电话" :content="`即将拨打电话${phone}`" cancleText="取消" confirmText="拨打" :show="callShow" @close="callShow = false"
@change="onCall" />
</up-popup> </up-popup>
</template> </template>
<script setup> <script setup>
import { import {
ref ref
} from "vue" } from "vue";
import modal from "@/components/modal.vue";
const addressType = ref(-1) 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({ const props = defineProps({
show: { show: {

View File

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

View File

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

View File

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