jiazhipeng 4 months ago
parent
commit
f0f6523fe7
  1. 6
      pages.json
  2. 2
      pages/user/user.vue
  3. 7
      static/js/request.js
  4. 4
      subPackages/techan/detail.vue
  5. 6
      subPackages/techan/index.vue
  6. 65
      subPackages/techan/order.vue

6
pages.json

@ -31,6 +31,12 @@
"style": {
"navigationBarTitleText": "uni-app"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"subPackages": [{

2
pages/user/user.vue

@ -10,7 +10,7 @@
class="headImg" v-else></image>
</view>
<view class="username" v-if="userInfo.nickname">{{userInfo.nickname}}</view>
<view class="username" v-else>请登录/注册 ></view>
<view class="username" >请登录/注册 ></view>
</view>
<view class="top-right" v-if="userInfo.nickname">
个人信息 <image src="https://static.ticket.sz-trip.com/tongli/images/user/rightIcon1.png" mode=""></image>

7
static/js/request.js

@ -2,8 +2,9 @@ import Vue from 'vue';
import store from '@/store';
// 定义 API URL
const DEV_API_URL = 'https://api.cloud.sz-trip.com';
const PROD_API_URL = 'https://api.cloud.sz-trip.com';
// const DEV_API_URL = 'https://api.cloud.sz-trip.com';
const DEV_API_URL = 'https://swsz.api.js-dyyj.com';
const PROD_API_URL = 'https://swsz.api.js-dyyj.com';
const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL;
// 获取token
@ -39,7 +40,7 @@ Vue.prototype.NEWAPIURL = '/api';
// #endif
Vue.prototype.Post = (params = {}, apiurl) => {
const token = getToken() || '0caa10fc-6d65-4d9c-8e57-b344be3fc526';
const token = getToken() ;
if (token) {
params.token = token;
}

4
subPackages/techan/detail.vue

@ -80,7 +80,7 @@
</uni-badge>
</view>
<uni-popup ref="popup" type="bottom" @change="changPopShow" style="position: relative;z-index: 50;">
<uni-popup ref="popup" type="bottom" @change="changPopShow" :safe-area="false" style="position: relative;z-index: 99;">
<view class="popup-content" v-if="sku.length>0">
<view style="padding: 0rpx 39rpx 50rpx 39rpx;">
<view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;">
@ -521,7 +521,7 @@
.btn-list {
position: fixed;
z-index: 9999;
z-index: 50;
bottom: 0;
width: 750rpx;
height: 140rpx;

6
subPackages/techan/index.vue

@ -17,7 +17,7 @@
<scroll-view class="type-container" scroll-x="true" scroll-with-animation="true" enable-flex>
<view :class="['type-item',typeIndex==i?'active':'']" v-for="(item,i) in typeParam" :key="i" @click="changeType(item,i)">
<view class="img-container" >
<image :src="item.image"></image>
<image :src="showImg(item.image)"></image>
</view>
<view class="type-name">{{item.name}}</view>
</view>
@ -207,7 +207,7 @@
<view class="type-container typedata-container">
<view :class="['type-item',typeIndex==i?'active':'']" v-for="(item,i) in typeParam" :key="i" @click="changeType(item,i)">
<view class="img-container" >
<image :src="item.image"></image>
<image :src="showImg(item.image)"></image>
</view>
<view class="type-name">{{item.name}}</view>
</view>
@ -230,7 +230,7 @@
statusBarHeight: 0,
headImg: "https://cgc.js-dyyj.com/uploads/20250513/f8b255f965efcd71b6843e4b72c3f1f3.png",
type_pid: 20,
type_pid: 646,
typeParam: [],
typeIndex: 0,
list:[],

65
subPackages/techan/order.vue

@ -42,7 +42,7 @@
<!-- 自提 -->
<view v-if="info.is_user_post!=1">
<view class="pickself" >
<navigator :url="`/subPackages/techan/selfPickUpPoint?pickupId=${info.pickupAddress.id}&goodsId=${info.sInfo.id}`">
<navigator :url="`/subPackages/techan/selfPickUpPoint?pickupId=${info.pickupAddress.id}&goodsId=${info.pInfo.id}`">
<view class="pickpoint">
<view class="flex-shrink-0">自提点</view>
<view class="pickpointAddress">
@ -105,15 +105,15 @@
<!-- 优惠券 -->
<view @click="goOrderCoupon" class="tickets-box flex-between">
<view @click="goOrderCoupon" class="tickets-container flex-between" v-if="!isShoppingCart">
<view class="order-title">优惠券</view>
<view class="coupon-btn" v-if="coupon==''">
<view class="select">选择优惠券</view>
<uni-icons style="height: 42rpx;" color="#999999" type="right" size="18"></uni-icons>
</view>
<div class="coupon-price" v-else>
<span v-if="coupon.percent == 0">-{{coupon.discounts/100}}</span>
<span v-else>-{{coupon.percent}}%</span>
<span v-if="coupon.activity.fold == 0">-{{coupon.activity.money/100}}</span>
<span v-else>-{{coupon.activity.fold*10}}%</span>
<span style="margin:0 31rpx 0 8rpx;color: #6C7A94;">></span>
</div>
</view>
@ -203,16 +203,25 @@ export default {
popShow: false, // 穿
addressTitle: '添加收货地址'
addressTitle: '添加收货地址',
isShoppingCart: false,
};
},
onLoad() {
onLoad(options) {
if (options.isShoppingCart) {
this.isShoppingCart = options.isShoppingCart
}
this.$store.commit("choseCoupon", "");
this.handleOrderGoods()
},
onShow() {
this.coupon = this.$store.state.user.coupon
if (!this.isShoppingCart) {
this.coupon = this.$store.state.user.coupon
}
//
uni.$on("updateDataByConnect",this.getDataByConnect)
@ -234,10 +243,11 @@ export default {
uni.navigateBack();
return
}
// use_type 0 1 3
// is_post 1 2 1
orderList.forEach(v=>{
v.is_post = v.sInfo.is_post || "1" //
v.is_user_post = v.sInfo.is_post==2?2:"1" //
v.is_post = v.sInfo.use_type==0?1:v.sInfo.use_type==1?2:3 //
v.is_user_post = v.sInfo.use_type==1?2:1 //
v.pickupAddress = {} //
v.contacts = null //
v.post = null //
@ -298,9 +308,6 @@ export default {
});
},
getPost() {
return
let tempList = []
this.orderList.forEach(v=>{
if( v.sInfo.contacts && v.is_user_post == 1) {
@ -419,19 +426,18 @@ export default {
}
this.allprice = allPrice + postPrice
if (this.coupon) {
if (this.coupon.percent == 0) {
if (this.coupon.discounts>allPrice) {
price =postPrice
if (this.coupon.activity.fold == 0) {
if (this.coupon.activity.money>allPrice) {
price =0
}else{
price = allPrice + postPrice - (this.coupon.discounts)
price = allPrice - (this.coupon.activity.money)
}
} else{
// bug
price = (allPrice + postPrice) - (allPrice * this.coupon.percent/100)
price = allPrice - allPrice * (this.coupon.activity.fold*10/100)
}
} else {
price = allPrice + postPrice
price = allPrice
}
return price < 0 ? 0 : (price/100).toFixed(2)
},
@ -1140,4 +1146,23 @@ view {
padding-bottom: 12rpx;
min-height: fit-content;
}
.tickets-container {
width: 698rpx;
background: #fff;
height: 120rpx;
margin: 22rpx auto 0;
.order-title {
margin: 31rpx 0 31rpx 30rpx;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
}
.coupon-price {
color:#DD0000;
font-size: 30rpx;
font-weight: bold;
}
}
</style>
Loading…
Cancel
Save