Browse Source

修IOS首页白屏问题,修改productList.vue文件报错

master
zhengshuiqi 3 years ago
parent
commit
32e697734c
  1. 62
      App.vue
  2. 12
      api/index.js
  3. 89
      api/request.js
  4. 3
      common/common.scss
  5. 23
      ios/index.js
  6. 5
      main.js
  7. 7
      manifest.json
  8. 11
      pages.json
  9. 10
      pages/account/deleteCount.vue
  10. 116
      pages/account/message.vue
  11. 474
      pages/account/myOrders.vue
  12. 678
      pages/category/productList.vue
  13. 10
      pages/index/address.vue
  14. 54
      pages/index/index.vue
  15. 616
      pages/index/index2.vue
  16. 589
      pages/order/confirmation.vue
  17. 263
      pages/order/details.vue
  18. 28
      project.config.json
  19. 7
      project.private.config.json

62
App.vue

@ -1,13 +1,59 @@
<script> <script>
import {defaultRequest,defaultRequest4} from 'api/index.js' import {
defaultRequest,
defaultRequest4
} from 'api/index.js'
var jpushModule = uni.requireNativePlugin("JG-JPush"); var jpushModule = uni.requireNativePlugin("JG-JPush");
export default { export default {
data(){ data() {
return { return {
backButtonPress:0, globalData:{
},
backButtonPress: 0,
} }
}, },
onLaunch: function() { onLaunch: function() {
// (IOS)
// uni.getNetworkType({
// success: function (res) {
// console.log(res.networkType);// wifi2g3g4gethernetunknownnone
// if(res.networkType === "none"){
// console.log("");
// this.globalData.typee = 1;
// console.log('=====', this.globalData.typee)
// }else{
// this.globalData.typee = 0
// console.log('==',this.globalData.typee)
// }
// }
// });
// alert(this.globalData.type)
// ios
// uni.getSystemInfo({
// success: (res) => {
// if (res.platform == 'ios') {
// const query = uni.createSelectorQuery().in(this);
// var isRecovery = true;
// query
// .select('#containerId')
// .boundingClientRect(data => {
// isRecovery = false;
// })
// .exec();
// var timer = setTimeout(() => {
// if (isRecovery) {
// uni.reLaunch({
// url: '/pages/tabbar/user/user'
// })
// clearTimeout(timer);
// timer = null;
// }
// }, 500)
// }
// },
// })
// ios
// console.log('App Launch') // console.log('App Launch')
uni.hideTabBar() uni.hideTabBar()
// uni.onTabBarMidButtonTap(()=>{ // uni.onTabBarMidButtonTap(()=>{
@ -19,15 +65,15 @@
// animationType:'slide-in-bottom' // animationType:'slide-in-bottom'
// }) // })
// }) // })
plus.screen.lockOrientation("portrait-primary"); // plus.screen.lockOrientation("portrait-primary");
setTimeout(() => { setTimeout(() => {
plus.navigator.closeSplashscreen(); // plus.navigator.closeSplashscreen();
}, 2400); }, 2400);
//#ifdef APP-PLUS //#ifdef APP-PLUS
jpushModule.setLoggerEnable(true); jpushModule.setLoggerEnable(true);
jpushModule.initJPushService() jpushModule.initJPushService()
jpushModule.addConnectEventListener(result=>{ jpushModule.addConnectEventListener(result => {
let connectEnable = result.connectEnable let connectEnable = result.connectEnable
console.log("jpush连接", connectEnable) console.log("jpush连接", connectEnable)
}) })
@ -89,10 +135,10 @@
</script> </script>
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ /*每个页面公共css */
@import "@/common/common.scss"; @import "@/common/common.scss";
page{
page {
overflow-x: hidden; overflow-x: hidden;
} }
</style> </style>

12
api/index.js

@ -1,6 +1,7 @@
import httpRequest from './request'; import httpRequest from './request';
//默认请求地址 //默认请求地址
export const defaultRequest =query=>{ export const defaultRequest =query=>{
return httpRequest({ return httpRequest({
url:'mapi/api_v2011.php?appcode=DOPE+', url:'mapi/api_v2011.php?appcode=DOPE+',
@ -75,3 +76,14 @@ export const defaultRequest5 =(query,comments)=>{
}) })
} }
// 银行支付 // 银行支付
// export const defaultRequest6 =query=>{
// return httpRequest({
// url:'mapi/api_v2011.php?appcode=DOPE+',
// method:'post',
// data:query,
// errMsg:true,
// isCookies:true,
// isEncryption:false,
// isLoad:true
// })
// }

89
api/request.js

@ -1,39 +1,43 @@
import config from '../config.js' import config from '../config.js'
import { encryptDes, decryptDes ,encrypt_by_des } from '@/utils/des.js' import {
encryptDes,
decryptDes,
encrypt_by_des
} from '@/utils/des.js'
import Base64 from 'base-64'; import Base64 from 'base-64';
import cryptoJS from "crypto-js" import cryptoJS from "crypto-js"
const httpRequest = (params) => { const httpRequest = (params) => {
if(params.isLoad){ if (params.isLoad) {
// uni.showLoading({ // uni.showLoading({
// title: "Loading..." // title: "Loading..."
// }); // });
} }
const json_data={ const json_data = {
appcode:'DOPE+' ,//应用编码 appcode: 'DOPE+', //应用编码
appchannel:'DOPEGOOGLE' ,//应用发布渠道 appchannel: 'DOPEGOOGLE', //应用发布渠道
appver: '1.0.0',//应用版本 appver: '1.0.0', //应用版本
appname:'cnic_buyer' ,//应用名称 appname: 'cnic_buyer', //应用名称
manufacturer:'HUAWEI' ,//设备生产商 manufacturer: 'HUAWEI', //设备生产商
phonebrand:'HORNOR' ,//设备品牌 phonebrand: 'HORNOR', //设备品牌
phonetype:'X30' ,//设备型号 phonetype: 'X30', //设备型号
phoneos:'ANDROID'// 设备系统 phoneos: 'ANDROID' // 设备系统
} }
let data=Object.assign(json_data,params.data) let data = Object.assign(json_data, params.data)
// console.info(data) // console.info(data)
uni.setStorageSync('appdata',data) uni.setStorageSync('appdata', data)
let key=params.key let key = params.key
if(params.isEncryption){ if (params.isEncryption) {
// console.info(JSON.parse(JSON.stringify(data.consignee))) // console.info(JSON.parse(JSON.stringify(data.consignee)))
key=encryption(JSON.parse(JSON.stringify(data[params.key]))) key = encryption(JSON.parse(JSON.stringify(data[params.key])))
// console.info(key) // console.info(key)
data=encryption(data) data = encryption(data)
// console.log(data) // console.log(data)
data[params.key]=key data[params.key] = key
}else{ } else {
data=encryption(data) data = encryption(data)
} }
// console.info(data) // console.info(data)
@ -41,24 +45,28 @@ const httpRequest = (params) => {
// console.info(encryptDes(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008')) // console.info(encryptDes(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008'))
// console.info(encrypt_by_des(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008')) // console.info(encrypt_by_des(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008'))
// data=Base64.encode(encryptDes(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008')); // data=Base64.encode(encryptDes(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008'));
data=encryptDes(JSON.stringify(data),'6780f04cf2e211ec86a8005056c00008'); data = encryptDes(JSON.stringify(data), '6780f04cf2e211ec86a8005056c00008');
// console.info(data) // console.info(data)
// 解密 // 解密
let data2 =JSON.parse(decryptDes(data,"6780f04cf2e211ec86a8005056c00008")) let data2 = JSON.parse(decryptDes(data, "6780f04cf2e211ec86a8005056c00008"))
// console.info(data2) // console.info(data2)
let data1={data:data} let data1 = {
data: data
}
let httpOptions = { let httpOptions = {
url: config.apiUri + params.url, url: config.apiUri + params.url,
data:data1, data: data1,
method: params.method, method: params.method,
header: { header: {
'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
// 'cookies':uni.getStorageSync('cookies') || "" // 'cookies':uni.getStorageSync('cookies') || ""
} }
}; };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
...httpOptions, ...httpOptions,
success: res => { success: res => {
@ -67,22 +75,22 @@ const httpRequest = (params) => {
// 进行解密 // 进行解密
// let list = res.data // let list = res.data
// res.data=JSON.parse(decryptDes(res.data,"6780f04cf2e211ec86a8005056c00008")) // res.data=JSON.parse(decryptDes(res.data,"6780f04cf2e211ec86a8005056c00008"))
res.data=JSON.parse(decryptDes(res.data,"6780f04cf2e211ec86a8005056c00008")) res.data = JSON.parse(decryptDes(res.data, "6780f04cf2e211ec86a8005056c00008"))
// res.data=Base64.decode(decryptDes(res.data,'6780f04cf2e211ec86a8005056c00008')); // res.data=Base64.decode(decryptDes(res.data,'6780f04cf2e211ec86a8005056c00008'));
// console.info(list) // console.info(list)
// res.data = list // res.data = list
if(res.data.error!=0 && params.errMsg){ if (res.data.error != 0 && params.errMsg) {
// uni.showToast({ // uni.showToast({
// // title: res.data.message, // // title: res.data.message,
// icon:'none', // icon:'none',
// duration: 2000 // duration: 2000
// }); // });
} }
if(res.data.error!=0 && params.isCookies){ if (res.data.error != 0 && params.isCookies) {
let user_info=uni.getStorageSync('user_info') let user_info = uni.getStorageSync('user_info')
user_info.isLogin=false user_info.isLogin = false
uni.setStorageSync('user_info',user_info) uni.setStorageSync('user_info', user_info)
} }
resolve(res.data); resolve(res.data);
}, },
@ -92,17 +100,20 @@ const httpRequest = (params) => {
reject(err); reject(err);
} }
}) })
}) })
} }
const encryption=(data)=>{ const encryption = (data) => {
for(let key in data){ for (let key in data) {
let item= data[key] let item = data[key]
if(key ==='comments'){ if (key === 'comments') {
data[key]=encryptDes(JSON.stringify(data[key]),'6780f04cf2e211ec86a8005056c00008'); data[key] = encryptDes(JSON.stringify(data[key]), '6780f04cf2e211ec86a8005056c00008');
data[key]=JSON.parse(decryptDes(data[key],"6780f04cf2e211ec86a8005056c00008")) data[key] = JSON.parse(decryptDes(data[key], "6780f04cf2e211ec86a8005056c00008"))
}else{ } else {
data[key]=encodeURIComponent(item) data[key] = encodeURIComponent(item)
} }
} }
return data return data

3
common/common.scss

@ -21,10 +21,9 @@
display: flex; display: flex;
color:#707070; color:#707070;
justify-content: space-around; justify-content: space-around;
.tarbar_img image{ .tarbar_img image {
height: 50rpx; height: 50rpx;
width: 50rpx; width: 50rpx;
// background-color: #fff; // background-color: #fff;
} }
.img_m image{ .img_m image{

23
ios/index.js

@ -0,0 +1,23 @@
// #import <CoreTelephony/CTCellularData.h>
// // 尝试解决IOS白屏问题
// //获取网络权限
// - (void)checkNetworkPermissions{
// CTCellularData *cellularData = [[CTCellularData alloc] init];
// // 状态发生变化时调用
// cellularData.cellularDataRestrictionDidUpdateNotifier = ^(CTCellularDataRestrictedState restrictedState) {
// switch (restrictedState) {
// case kCTCellularDataRestrictedStateUnknown:
// NSLog(@"蜂窝移动网络状态:未知");
// break;
// case kCTCellularDataRestricted:
// NSLog(@"蜂窝移动网络状态:关闭");
// break;
// case kCTCellularDataNotRestricted:
// NSLog(@"蜂窝移动网络状态:开启");
// break;
// default:
// break;
// }
// };
// }

5
main.js

@ -1,13 +1,14 @@
import App from './App' import App from './App'
import store from '@/store/store.js' import store from '@/store/store.js'
import ios from '@/ios/index.js'
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
...App, ...App,
store store,
ios
}) })

7
manifest.json

@ -1,6 +1,6 @@
{ {
"name" : "DopePlus", "name" : "DopePlus",
"appid" : "__UNI__A6CF3EA", "appid" : "__UNI__9088064",
// "appid" : "__UNI__7D4CA0F", // "appid" : "__UNI__7D4CA0F",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
@ -310,7 +310,10 @@
"mp-weixin" : { "mp-weixin" : {
"appid" : "", "appid" : "",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false,
"es6" : false,
"postcss" : false,
"enhance": true
}, },
"usingComponents" : true "usingComponents" : true
}, },

11
pages.json

@ -381,6 +381,7 @@
// //
"bounce": "none", "bounce": "none",
"usingComponents" : false, "usingComponents" : false,
// "subPackages": true,
"optimization": { "optimization": {
"subPackages": true "subPackages": true
}, },
@ -435,6 +436,16 @@
} }
] ]
},
"condition" : { //
"current": 0, //(list )
"list": [
{
"name": "", //
"path": "", //
"query": "" //onLoad
}
]
} }
} }

10
pages/account/deleteCount.vue

@ -2,9 +2,9 @@
<view> <view>
<view class="font"> <view class="font">
<!-- <uni-icons type="arrow-left" size="30" @click="back" color="#fff"></uni-icons> --> <!-- <uni-icons type="arrow-left" size="30" @click="back" color="#fff"></uni-icons> -->
<uni-icons type="back" size="30" @click="back" style="font-weight: 100;" color="#fff"></uni-icons> <uni-icons type="back" size="22" @click="back" style="font-weight: 100;padding-left: 20rpx;" color="#fff"></uni-icons>
<text style="margin-left: 30rpx;color: white;">Delete account</text> <text style="color: white;display: flex;justify-content: center;font-weight: 500; align-items: center; text-align: center; margin: 0 auto;color: white;">Delete account</text>
</view> </view>
<view class="text_item"> <view class="text_item">
Once you deactivate account, your account information will no longer be accessible. Once you deactivate account, your account information will no longer be accessible.
@ -129,11 +129,11 @@
display: flex; display: flex;
background-color:#000000; background-color:#000000;
color:white; color:white;
height: 100rpx; height: 42px;
line-height: 100rpx; line-height: 100rpx;
text-align: center; text-align: center;
padding-top:50rpx; padding-top: 20px;
padding-left:20rpx; // padding-left:20rpx;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
} }

116
pages/account/message.vue

@ -2,7 +2,9 @@
<view class="body"> <view class="body">
<view class="font"> <view class="font">
<uni-icons style="z-index: 1111;position: relative; padding-left: 11px;color: white;font-weight: 100;cursor: pointer;" type="back" size="23" @click="backs"></uni-icons> <uni-icons
style="z-index: 1111;position: relative; padding-left: 11px;color: white;font-weight: 100;cursor: pointer;"
type="back" size="23" @click="backs"></uni-icons>
<text style="margin-left: 30%;color: white;">Message</text> <text style="margin-left: 30%;color: white;">Message</text>
</view> </view>
@ -15,8 +17,48 @@
</view> </view>
<view class="mask" v-show="isShwo" @click="isShwo=false"></view> <view class="mask" v-show="isShwo" @click="isShwo=false"></view>
<button class="body-btn">Continue shopping</button> <button class="body-btn">Continue shopping</button>
<view>
<!-- <uni-nav-bar left-icon="left" :statusBar="true" title="Message"
color="#fff" backgroundColor="#000000" @clickLeft="back" :border="false"/> -->
<!-- <view class="one">
<image src="../../static/img/left_white.png" mode="" @click="back()"></image>
<view class="one_text">Message</view>
</view> -->
<view class="body">
<view class="msg_item" v-for="(item,index) in list.blocks" :key="item.block_title" @click="gotopage(item)">
<view class="msg_time">{{item.block_avaiable_from | Mes}}</view>
<!-- <text class="y_red" v-show="item.block_id"></text> -->
<!-- <view class="msg_content">{{item.}}</view> -->
<view class="msg_img" v-if="item.block_pic">
<image :src="item.block_pic" class="imagesize"></image>
</view> </view>
</template> <view class="msg_title">{{item.block_title}}</view>
</view>
<view class="msg_item" v-for="(item,index) in app_Mes" :key="item.id" @click="gotopage(item)">
<view class="msg_time">{{ item.add_time | Mes}}</view>
<text class="y_red" v-show="item.unread == 1"></text>
<view class="msg_title">{{ item.mtitle }}</view>
<view class="msg_content">
</view>
</view>
<!-- <view class="msg_item">
<view class="msg_time">21/04/2022 14:42:31</view>
<view class="msg_title">Message heading</view>
<view class="msg_content">
estimated to be deliverd on estimated to be deliverd on estim
ated to be deliverd on estimated to be deliverd on
</view>
<view class="msg_img"></view>
</view> -->
</view>
</view>
</view>
</template>
<script> <script>
import { import {
@ -251,4 +293,74 @@
background-color: white; background-color: white;
opacity: 0; opacity: 0;
} }
.uni-navbar {
font-size: 32rpx;
font-weight: bold;
}
.y_red {
font-size: 19rpx;
color: #940000;
;
}
.body {
// border-top: 13.33rpx #F7F7F7 solid;
padding: 50.67rpx 26.67rpx;
}
.msg_item {
padding-top: 17rpx;
padding-bottom: 28rpx;
padding-left: 10rpx;
padding-right: 10rpx;
background-color: #fff;
// border-bottom: 1px solid #E2E2E2;
margin-bottom: 30rpx;
&:first-child {
margin-top: 122.67rpx;
}
.msg_time {
font-size: 25.33rpx;
font-weight: 400;
text-align: center;
// margin-top: 51.33rpx;
}
.msg_title {
font-size: 28rpx;
margin-top: 20rpx;
margin-left: 10rpx;
}
.msg_content {
color: #555555;
font-size: 25.33rpx;
font-weight: 400;
}
.msg_img {
margin-top: 27.33rpx;
border-radius: 10rpx;
width: 100%;
height: 281.33rpx;
background-color: #ffdcd3;
}
}
.msg_item:last-child {
border-bottom: none;
}
.imagesize {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
</style> </style>

474
pages/account/myOrders.vue

@ -2,7 +2,8 @@
<view> <view>
<view class="order_nav"> <view class="order_nav">
<scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false"> <scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false">
<view :class="scroll_active==index?'scroll_active':''" v-for="(item,index) in scrollList" @click="scrollChange(index)" :key="index">{{item.text}}</view> <view :class="scroll_active==index?'scroll_active':''" v-for="(item,index) in scrollList"
@click="scrollChange(index)" :key="index">{{item.text}}</view>
</scroll-view> </scroll-view>
</view> </view>
@ -18,9 +19,11 @@
<!-- 已取消订单 --> <!-- 已取消订单 -->
<text v-else-if="item.order_status_code==2">cancelled</text> <text v-else-if="item.order_status_code==2">cancelled</text>
<!-- 待发货订单 --> <!-- 待发货订单 -->
<text v-else-if="item.pay_status_code==2 && item.shipping_status_code==0">To be shipped</text> <text v-else-if="item.pay_status_code==2 && item.shipping_status_code==0">To be
shipped</text>
<!-- 运输中订单 --> <!-- 运输中订单 -->
<text v-else-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4">Shipped</text> <text
v-else-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4">Shipped</text>
<!-- 已完成订单 --> <!-- 已完成订单 -->
<text v-else-if="item.pay_status_code==2 && item.shipping_status_code==2">Completed</text> <text v-else-if="item.pay_status_code==2 && item.shipping_status_code==2">Completed</text>
@ -31,9 +34,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -52,7 +56,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -76,9 +81,11 @@
<button class="pay" @click.stop="payNow(item.order_id,0)">PAY NOW</button> <button class="pay" @click.stop="payNow(item.order_id,0)">PAY NOW</button>
</template> </template>
<!-- 已取消订单 --> <!-- 已取消订单 -->
<button v-if="item.order_status_code==2" class="cancel" @click.stop="openTips(item.order_id,1)">DELETE ORDER</button> <button v-if="item.order_status_code==2" class="cancel"
@click.stop="openTips(item.order_id,1)">DELETE ORDER</button>
<!-- 待发货订单 --> <!-- 待发货订单 -->
<template v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4"> <template
v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4">
<button class="cancel" @click.stop="goLogistics(item.order_id)">LOGISTICS</button> <button class="cancel" @click.stop="goLogistics(item.order_id)">LOGISTICS</button>
<button class="pay" @click.stop="openTips(item.order_id,2)">CONFIRM RECEIPT</button> <button class="pay" @click.stop="openTips(item.order_id,2)">CONFIRM RECEIPT</button>
</template> </template>
@ -86,7 +93,8 @@
<template v-if="item.pay_status_code==2 && item.shipping_status_code==2"> <template v-if="item.pay_status_code==2 && item.shipping_status_code==2">
<button class="cancel" @click.stop="goLogistics(item.order_id)">LOGISTICS</button> <button class="cancel" @click.stop="goLogistics(item.order_id)">LOGISTICS</button>
<button class="cancel" @click.stop="openTips(item.order_id,1)">DELETE ORDER</button> <button class="cancel" @click.stop="openTips(item.order_id,1)">DELETE ORDER</button>
<button class="pay" @click.stop="goComment(item)" v-if="item.comment_status_code==0">COMMENT</button> <button class="pay" @click.stop="goComment(item)"
v-if="item.comment_status_code==0">COMMENT</button>
</template> </template>
</view> </view>
</view> </view>
@ -98,9 +106,10 @@
<!-- 待支付订单 --> <!-- 待支付订单 -->
<template v-if="isList==true && scroll_active==1"> <template v-if="isList==true && scroll_active==1">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id"> <view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" @click="goDetails(item,item.order_id)" v-if="item.pay_status_code==0 && item.order_status_code==0"> <view class="order" @click="goDetails(item,item.order_id)"
v-if="item.pay_status_code==0 && item.order_status_code==0">
<view class="order_title"> <view class="order_title">
<text >Waiting for payment</text> <text>Waiting for payment</text>
<view class="order_title_right"> <view class="order_title_right">
<text>order#{{item.order_sn}}</text> <text>order#{{item.order_sn}}</text>
<image src="../../static/img/right.png" mode=""></image> <image src="../../static/img/right.png" mode=""></image>
@ -108,9 +117,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -129,7 +139,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -159,7 +170,8 @@
<!-- 待发货订单 --> <!-- 待发货订单 -->
<template v-if="isList==true && scroll_active==2"> <template v-if="isList==true && scroll_active==2">
<view v-for="(item,idnex) in orderList" :key="item.order_id"> <view v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==0" @click="goDetails(item,item.order_id)"> <view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==0"
@click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>To be shipped</text> <text>To be shipped</text>
<view class="order_title_right"> <view class="order_title_right">
@ -169,9 +181,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -190,7 +203,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -210,7 +224,9 @@
<!-- 运输中订单 --> <!-- 运输中订单 -->
<template v-if="isList==true && scroll_active==3"> <template v-if="isList==true && scroll_active==3">
<view v-for="(item,idnex) in orderList" :key="item.order_id"> <view v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4" @click="goDetails(item,item.order_id)"> <view class="order"
v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4"
@click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Shipped</text> <text>Shipped</text>
<view class="order_title_right"> <view class="order_title_right">
@ -220,9 +236,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -241,7 +258,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -265,7 +283,8 @@
<!-- 已完成订单 --> <!-- 已完成订单 -->
<template v-if="isList==true && scroll_active==5"> <template v-if="isList==true && scroll_active==5">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id"> <view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order " v-if="item.pay_status_code==2 && item.shipping_status_code==2" @click="goDetails(item,item.order_id)"> <view class="order " v-if="item.pay_status_code==2 && item.shipping_status_code==2"
@click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Completed</text> <text>Completed</text>
<view class="order_title_right"> <view class="order_title_right">
@ -275,9 +294,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -296,7 +316,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -310,7 +331,8 @@
<view class="order_button"> <view class="order_button">
<button class="cancel" @click.stop="goLogistics(item.order_id)">LOGISTICS</button> <button class="cancel" @click.stop="goLogistics(item.order_id)">LOGISTICS</button>
<button class="cancel" @click.stop="openTips(item.order_id,1)">DELETE ORDER</button> <button class="cancel" @click.stop="openTips(item.order_id,1)">DELETE ORDER</button>
<button class="pay" @click.stop="goComment(item)" v-if="item.comment_status_code==0">COMMENT</button> <button class="pay" @click.stop="goComment(item)"
v-if="item.comment_status_code==0">COMMENT</button>
</view> </view>
</view> </view>
</view> </view>
@ -331,9 +353,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -352,7 +375,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -385,9 +409,10 @@
</view> </view>
<view class="order_content"> <view class="order_content">
<template v-if="item.order_goods.length==1"> <template v-if="item.order_goods.length==1">
<view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1" @click.stop="goGoodsDetails(item1.goods_id)"> <view class="good_info" v-for="(item1,index1) in item.order_goods" :key="index1"
@click.stop="goGoodsDetails(item1.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image" > <view class="good_info_image">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -406,7 +431,8 @@
<template v-else> <template v-else>
<view class="good_info" @click.stop="showGoods(item.order_goods,1)"> <view class="good_info" @click.stop="showGoods(item.order_goods,1)">
<view class="good_info_left"> <view class="good_info_left">
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> <view class="good_info_image" v-for="(item1,index1) in item.order_goods"
:key="index1">
<image :src="item1.goods_img" mode=""></image> <image :src="item1.goods_img" mode=""></image>
</view> </view>
</view> </view>
@ -447,24 +473,26 @@
</text> </text>
<image src="../../static/img/close1.png" mode="" @click="isShow=false"></image> <image src="../../static/img/close1.png" mode="" @click="isShow=false"></image>
</view> </view>
<view class="order_popup_pay" > <view class="order_popup_pay">
<view class="pay_item" @click="selectPay(0)"> <view class="pay_item" @click="selectPay(0)">
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==0"></image> <image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==0">
</image>
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> <image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image>
<view class="pay_item_right"> <view class="pay_item_right">
<image src="../../static/img/pay_pal.png" mode=""></image> <image src="../../static/img/pay_pal.png" mode=""></image>
<text>Pay Pal</text> <text>Pay Pal</text>
</view> </view>
</view> </view>
<!-- <view class="pay_item" @click="selectPay(1)"> <view class="pay_item" @click="selectPay(1)">
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==1"></image> <image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==1">
</image>
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> <image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image>
<view class="pay_item_right"> <view class="pay_item_right">
<image src="../../static/img/card.png" mode=""></image> <image src="../../static/img/card.png" mode=""></image>
<text>Credit/Debit Card</text> <text>Credit/Debit Card</text>
</view> </view>
</view> </view>
<view class="pay_item" @click="selectPay(2)"> <!-- <view class="pay_item" @click="selectPay(2)">
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==2"></image> <image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==2"></image>
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> <image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image>
<view class="pay_item_right"> <view class="pay_item_right">
@ -490,10 +518,11 @@
</text> </text>
<image src="../../static/img/close1.png" mode="" @click="isShow=false"></image> <image src="../../static/img/close1.png" mode="" @click="isShow=false"></image>
</view> </view>
<view class="order_popup_commodity" > <view class="order_popup_commodity">
<view class="good_info padding_left " v-for="(item,index) in goods_list " :key="index" @click.stop="goGoodsDetails(item.goods_id)"> <view class="good_info padding_left " v-for="(item,index) in goods_list " :key="index"
@click.stop="goGoodsDetails(item.goods_id)">
<view class="good_info_left "> <view class="good_info_left ">
<view class="good_info_image img_border" > <view class="good_info_image img_border">
<image :src="item.goods_img" mode="" class="img_border"></image> <image :src="item.goods_img" mode="" class="img_border"></image>
</view> </view>
<view class="left_info"> <view class="left_info">
@ -514,135 +543,181 @@
</view> </view>
<!-- 删除取消弹框 --> <!-- 删除取消弹框 -->
<uni-popup ref="alertDialog" type="dialog"> <uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="error" cancelText="Close" :confirmText="tipsBut" title="Tips" :content="tipsInfo" @confirm="dialogConfirm" ></uni-popup-dialog> <uni-popup-dialog type="error" cancelText="Close" :confirmText="tipsBut" title="Tips" :content="tipsInfo"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import {defaultRequest2} from '../../api/index.js' import {
defaultRequest2
} from '../../api/index.js'
export default { export default {
data() { data() {
return { return {
scrollList:[{text:'All'},{text:'Unpaid'},{text:'Processing'},{text:'Shipped'},{text:'Completed'},{text:'Closed'}], scrollList: [{
scroll_active:0, text: 'All'
isList:true, }, {
orderList:[], text: 'Unpaid'
isShow:false, }, {
text: 'Processing'
}, {
text: 'Shipped'
}, {
text: 'Completed'
}, {
text: 'Closed'
}],
scroll_active: 0,
isList: true,
orderList: [],
isShow: false,
// 0 1 // 0 1
showType:0, showType: 0,
payQuery:{ payQuery: {
_action:'payorder', _action: 'payorder',
order_id:'', order_id: '',
order_type:'GOODSBUY', order_type: 'GOODSBUY',
payment_method:'alipay.native' payment_method: 'alipay.native'
}, },
pay_index:0, pay_index: 0,
cancelQuery:{ cancelQuery: {
_action:'cancelorder', _action: 'cancelorder',
order_id:'' order_id: ''
}, },
// 0 1 2 // 0 1 2
tipsType:0, tipsType: 0,
tipsInfo:'', tipsInfo: '',
tipsBut:'', tipsBut: '',
goods_list:[], goods_list: [],
query:{_action:'getuserorders',page_index:1,page_size:10,payingstatus:'',status:'',shippingstatus:''} query: {
_action: 'getuserorders',
page_index: 1,
page_size: 10,
payingstatus: '',
status: '',
shippingstatus: ''
}
} }
}, },
methods:{ methods: {
// //
goGoodsDetails(id){ goGoodsDetails(id) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/productDetails/index?goodid='+id url: '/pages/productDetails/index?goodid=' + id
}) })
}, },
// //
goComment(item){ goComment(item) {
uni.navigateTo({ uni.navigateTo({
url:'../productDetails/review?data='+JSON.stringify(item) url: '../productDetails/review?data=' + JSON.stringify(item)
}) })
}, },
showGoods(goodsList,type){ showGoods(goodsList, type) {
this.isShow=true this.isShow = true
this.showType=type this.showType = type
this.goods_list=goodsList this.goods_list = goodsList
}, },
// //
goLogistics(id){ goLogistics(id) {
uni.navigateTo({ uni.navigateTo({
url:'../order/logisticsDetails?order_id='+id url: '../order/logisticsDetails?order_id=' + id
}) })
}, },
// //
goDetails(item,id){ goDetails(item, id) {
let index let index
if(item.pay_status_code==0 && item.order_status_code==0){ if (item.pay_status_code == 0 && item.order_status_code == 0) {
index=0 index = 0
}else if(item.order_status_code==2){ } else if (item.order_status_code == 2) {
index=4 index = 4
}else if(item.pay_status_code==2 && item.shipping_status_code==0){ } else if (item.pay_status_code == 2 && item.shipping_status_code == 0) {
index=1 index = 1
}else if(item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4){ } else if (item.pay_status_code == 2 && item.shipping_status_code == 1 || item.shipping_status_code == 4) {
index=2 index = 2
}else if(item.pay_status_code==2 && item.shipping_status_code==2){ } else if (item.pay_status_code == 2 && item.shipping_status_code == 2) {
index=3 index = 3
}else if(item.order_status_code==4){ } else if (item.order_status_code == 4) {
// 退 // 退
index=5 index = 5
} }
let url='../order/details?details_index='+index+'&id='+id let url = '../order/details?details_index=' + index + '&id=' + id
if(index==5){ if (index == 5) {
url='../order/refundDetails' url = '../order/refundDetails'
} }
uni.navigateTo({ uni.navigateTo({
url:url url: url
}) })
}, },
// //
selectPay(index){ selectPay(index) {
this.pay_index=index this.pay_index = index
}, },
// //
getPayDate(){ getPayDate() {
if(this.pay_index ==0){ if (this.pay_index == 0) {
let data={_action:'payorder',order_id:this.payQuery.order_id,order_type:'GOODSBUY',payment_method:'paypal'} let data = {
defaultRequest2(data).then(res=>{ _action: 'payorder',
console.info(res,'支付') order_id: this.payQuery.order_id,
if(res.error == 0){ order_type: 'GOODSBUY',
payment_method: 'paypal'
}
defaultRequest2(data).then(res => {
console.info(res, '支付')
if (res.error == 0) {
let url = res.data.prepay_data.checkoutnow_url let url = res.data.prepay_data.checkoutnow_url
console.log(url) console.log(url)
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) // plus.runtime.openURL(res.data.prepay_data.checkoutnow_url)
uni.navigateTo({ uni.navigateTo({
url:'../order/paypalWebview?src='+url url: '../order/paypalWebview?src=' + url
}) })
} }
}) })
}else{ } else if (this.pay_index == 1) {
defaultRequest2(this.payQuery).then(res=>{ let data = {
_action: 'payorder',
order_id: this.payQuery.order_id,
order_type: 'GOODSBUY',
payment_method: 'oceanpay'
}
defaultRequest2(data).then(res => {
console.info(res, '支付')
if (res.error == 0) {
let url = res.data.prepay_data.checkoutnow_url
console.log(url)
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url)
uni.navigateTo({
url: '../order/paypalWebview?src=' + url
})
}
})
} else {
defaultRequest2(this.payQuery).then(res => {
console.info(res) console.info(res)
if(res.error==0){ if (res.error == 0) {
// //
if(res.data.need_pay_amount==0) return if (res.data.need_pay_amount == 0) return
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', provider: 'alipay',
orderInfo: res.data.prepay_data.order_info, // orderInfo: res.data.prepay_data.order_info, //
success: function (res) { success: function(res) {
console.log('success:' + JSON.stringify(res)); console.log('success:' + JSON.stringify(res));
this.isShow=false this.isShow = false
uni.navigateTo({ uni.navigateTo({
url: '../order/paySuccess?order_id='+this.payQuery.order_id url: '../order/paySuccess?order_id=' + this.payQuery
.order_id
}); });
}, },
fail: function (err) { fail: function(err) {
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
uni.showToast({ uni.showToast({
title:'Payment failed', title: 'Payment failed',
icon:'none' icon: 'none'
}) })
} }
}); });
@ -650,57 +725,58 @@
}) })
} }
}, },
payNow(id,type){ payNow(id, type) {
this.payQuery.order_id=id this.payQuery.order_id = id
this.isShow=true this.isShow = true
this.showType=type this.showType = type
}, },
// //
openTips(id,type){ openTips(id, type) {
this.tipsType=type this.tipsType = type
if(type==0){ if (type == 0) {
this.tipsInfo='Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation' this.tipsInfo =
this.tipsBut='CancelOrder' 'Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation'
this.cancelQuery._action='cancelorder' this.tipsBut = 'CancelOrder'
}else if(type==1){ this.cancelQuery._action = 'cancelorder'
this.tipsInfo='Are you sure you want to delete this order?' } else if (type == 1) {
this.tipsBut='DeleteOrder' this.tipsInfo = 'Are you sure you want to delete this order?'
this.cancelQuery._action='deleteorder' this.tipsBut = 'DeleteOrder'
}else if(type==2){ this.cancelQuery._action = 'deleteorder'
this.tipsInfo='Are you sure you have received the products?' } else if (type == 2) {
this.tipsBut='Confirm' this.tipsInfo = 'Are you sure you have received the products?'
this.cancelQuery._action='affirmorder' this.tipsBut = 'Confirm'
} this.cancelQuery._action = 'affirmorder'
this.cancelQuery.order_id=id }
this.cancelQuery.order_id = id
this.$refs.alertDialog.open() this.$refs.alertDialog.open()
}, },
// //
dialogConfirm(){ dialogConfirm() {
defaultRequest2(this.cancelQuery).then(res=>{ defaultRequest2(this.cancelQuery).then(res => {
console.info(res) console.info(res)
if(res.error==0){ if (res.error == 0) {
this.getList() this.getList()
} }
}) })
}, },
getList(){ getList() {
defaultRequest2(this.query).then(res=>{ defaultRequest2(this.query).then(res => {
console.info(res) console.info(res)
if(res.error==0){ if (res.error == 0) {
if(res.data) this.orderList=res.data if (res.data) this.orderList = res.data
if(this.orderList.length==0){ if (this.orderList.length == 0) {
this.isList=false this.isList = false
}else{ } else {
this.isList=true this.isList = true
} }
} }
}) })
}, },
scrollChange(index){ scrollChange(index) {
// {_action:'getuserorders',page_index:1,page_size:10,payingstatus:'',status:'',shippingstatus:''} // {_action:'getuserorders',page_index:1,page_size:10,payingstatus:'',status:'',shippingstatus:''}
this.scroll_active=index this.scroll_active = index
// if(index==0){ // if(index==0){
// this.query.payingstatus='' // this.query.payingstatus=''
// this.query.status='' // this.query.status=''
@ -718,33 +794,36 @@
}, },
onLoad(e) { onLoad(e) {
this.scrollChange(0) this.scrollChange(0)
this.scroll_active=e.scroll_active this.scroll_active = e.scroll_active
this.scrollChange(e.index) this.scrollChange(e.index)
}, },
filters:{ filters: {
goodsAttr(e){ goodsAttr(e) {
return e.replace(/\s\n/g,';'); return e.replace(/\s\n/g, ';');
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.body{ .body {
padding-top: 100rpx; padding-top: 100rpx;
} }
.padding_left{
.padding_left {
padding-left: 20rpx; padding-left: 20rpx;
} }
.order_nav{
padding:0 38.67rpx ; .order_nav {
padding: 0 38.67rpx;
border-bottom: 13.33rpx #F7F7F7 solid; border-bottom: 13.33rpx #F7F7F7 solid;
position: fixed; position: fixed;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
z-index: 99; z-index: 99;
background-color: white; background-color: white;
.scroll-view_H{
.scroll-view_H {
white-space: nowrap; white-space: nowrap;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
@ -755,15 +834,18 @@
height: 0; height: 0;
background-color: transparent; background-color: transparent;
} }
view{
view {
margin-left: 37.33rpx; margin-left: 37.33rpx;
display: inline-block; display: inline-block;
padding: 25.33rpx 0; padding: 25.33rpx 0;
} }
view:first-child{
view:first-child {
margin-left: 0; margin-left: 0;
} }
.scroll_active{
.scroll_active {
color: #000000; color: #000000;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
@ -771,10 +853,12 @@
} }
} }
} }
.order{
.order {
border-bottom: 13.33rpx #F7F7F7 solid; border-bottom: 13.33rpx #F7F7F7 solid;
padding-bottom: 26.67rpx; padding-bottom: 26.67rpx;
.order_title{
.order_title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@ -785,24 +869,26 @@
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-bottom: 1px solid #F1F1F1; border-bottom: 1px solid #F1F1F1;
.order_title_right{ .order_title_right {
font-size: 22.67rpx; font-size: 22.67rpx;
font-weight: bold; font-weight: bold;
color: #666666; color: #666666;
image{ image {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
margin-left: 14.67rpx; margin-left: 14.67rpx;
} }
} }
} }
.order_content{
.order_content {
padding-left: 32rpx; padding-left: 32rpx;
padding-right: 26.67rpx; padding-right: 26.67rpx;
// background-color: #B22234; // background-color: #B22234;
margin-top: -30rpx; margin-top: -30rpx;
.good_info{
.good_info {
padding-top: 60rpx; padding-top: 60rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -811,32 +897,36 @@
color: #666666; color: #666666;
font-weight: bold; font-weight: bold;
border-bottom: 1px solid #F1F1F1; border-bottom: 1px solid #F1F1F1;
.good_info_left{
.good_info_left {
display: flex; display: flex;
align-items: center; align-items: center;
.good_info_image{ .good_info_image {
width: 133.33rpx; width: 133.33rpx;
height: 133.33rpx; height: 133.33rpx;
background-color: #999999; background-color: #999999;
margin-right: 8rpx; margin-right: 8rpx;
border-radius: 10rpx !important; border-radius: 10rpx !important;
image{
image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx; border-radius: 10rpx;
} }
} }
.left_info{
.left_info {
margin-left: 24rpx; margin-left: 24rpx;
.info_name{ .info_name {
font-size: 26.67rpx; font-size: 26.67rpx;
font-weight: 400; font-weight: 400;
width: 477.33rpx; width: 477.33rpx;
} }
.left_info_bottom{
.left_info_bottom {
width: 533.33rpx !important; width: 533.33rpx !important;
display: flex; display: flex;
align-items: center; align-items: center;
@ -845,12 +935,14 @@
color: #909090; color: #909090;
width: 100%; width: 100%;
margin-top: 24rpx; margin-top: 24rpx;
.info_lable{
.info_lable {
padding: 5.33rpx 20rpx; padding: 5.33rpx 20rpx;
font-size: 22.67rpx; font-size: 22.67rpx;
// border-radius: 33.33rpx; // border-radius: 33.33rpx;
// border: 1px solid #D3D3D3; // border: 1px solid #D3D3D3;
image{ image {
width: 17.33rpx; width: 17.33rpx;
height: 17.33rpx; height: 17.33rpx;
margin-left: 14.67rpx; margin-left: 14.67rpx;
@ -859,41 +951,47 @@
} }
} }
} }
.good_info_right{
.good_info_right {
display: flex; display: flex;
align-items: center; align-items: center;
image{
image {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
margin-left: 20rpx; margin-left: 20rpx;
} }
} }
} }
.good_price{
.good_price {
font-size: 28rpx; font-size: 28rpx;
text-align: right; text-align: right;
margin: 24rpx 0; margin: 24rpx 0;
} }
.good_points{
.good_points {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
font-size: 24rpx; font-size: 24rpx;
color: #B22234; color: #B22234;
image{ image {
width: 29.33rpx; width: 29.33rpx;
height: 29.33rpx; height: 29.33rpx;
margin-right: 13.33rpx; margin-right: 13.33rpx;
} }
} }
.order_button{
.order_button {
margin-top: 33.33rpx; margin-top: 33.33rpx;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
background-color: #FFF; background-color: #FFF;
button{
button {
height: 57.33rpx; height: 57.33rpx;
line-height: 57.33rpx; line-height: 57.33rpx;
font-weight: bold; font-weight: bold;
@ -902,14 +1000,18 @@
background-color: #fff; background-color: #fff;
margin: 0; margin: 0;
border-radius: 0rpx; border-radius: 0rpx;
// border:green solid 4rpx; // border:green solid 4rpx;
&:last-child{ &:last-child {
margin-right: 0 !important; margin-right: 0 !important;
} }
} }
button:after{
border:none;} button:after {
.cancel{ border: none;
}
.cancel {
color: #666666; color: #666666;
border: black solid 1rpx; border: black solid 1rpx;
// border: white !important; // border: white !important;
@ -918,7 +1020,8 @@
background-color: #fff; background-color: #fff;
} }
.pay{
.pay {
color: white; color: white;
border-radius: 0; border-radius: 0;
background: black; background: black;
@ -927,7 +1030,8 @@
} }
} }
} }
.order1{
.order1 {
padding-top: 90.67rpx; padding-top: 90.67rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
@ -935,12 +1039,14 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
image{
image {
width: 146.67rpx; width: 146.67rpx;
height: 146.67rpx; height: 146.67rpx;
margin-bottom: 36rpx; margin-bottom: 36rpx;
} }
button{
button {
background-color: #000000; background-color: #000000;
font-size: 24rpx; font-size: 24rpx;
color: white; color: white;

678
pages/category/productList.vue

File diff suppressed because it is too large

10
pages/index/address.vue

@ -3,7 +3,7 @@
<view class="body"> <view class="body">
<view class="font"> <view class="font">
<!-- <uni-icons style="padding-left: 11px;color: white;" type="arrow-left" size="30" @click="back"></uni-icons> --> <!-- <uni-icons style="padding-left: 11px;color: white;" type="arrow-left" size="30" @click="back"></uni-icons> -->
<uni-icons style="padding-left: 11px;color: white;font-weight: 100;" type="back" size="30" @click="back"></uni-icons> <uni-icons style="padding-left: 11px;color: white;font-weight: 100;" type="back" size="22" @click="back"></uni-icons>
<text style="margin-left: 30%;color: white;">Ship to</text> <text style="margin-left: 30%;color: white;">Ship to</text>
</view> </view>
<!-- <view class="text_pop">Popular Countries/Regions</view> <!-- <view class="text_pop">Popular Countries/Regions</view>
@ -12,7 +12,7 @@
<radio class="Radio"v-model="item2.name" :checked="current==item2.name"@click="Active(item2,index2)"></radio> <radio class="Radio"v-model="item2.name" :checked="current==item2.name"@click="Active(item2,index2)"></radio>
</view> --> </view> -->
<view class="address1"></view> <view class="address1"></view>
<view style="padding-top: 40rpx;"> <view style="padding-top: 5px;">
<view v-for ="(item,index) in list " :key="index" > <view v-for ="(item,index) in list " :key="index" >
<text class="color_red">{{ item.title}}</text> <text class="color_red">{{ item.title}}</text>
<view class="address" v-for="(item1,index1) in item.sur_name" :key="item1.name" > <view class="address" v-for="(item1,index1) in item.sur_name" :key="item1.name" >
@ -150,15 +150,15 @@ async onLoad() {
display: flex; display: flex;
position: fixed; position: fixed;
background-color: #000; background-color: #000;
height: 100rpx;
width: 100%; width: 100%;
z-index: 999; z-index: 999;
padding-top: 50rpx; height: 42px;
padding-top: 20px;
text-align: center; text-align: center;
top:0; top:0;
left: 0; left: 0;
font-size: 20px; font-size: 20px;
font-weight: bold; /* font-weight: bold; */
} }
.address1{ .address1{
height: 50rpx; height: 50rpx;

54
pages/index/index.vue

@ -7,10 +7,12 @@
import { import {
tarbar tarbar
} from '../../tarbar/index.vue' } from '../../tarbar/index.vue'
export default { const app = getApp();
export default {
data() { data() {
return { return {
typee: '',
mycurrent: 0, mycurrent: 0,
isScrollShow: false, isScrollShow: false,
scroll_active: 0, scroll_active: 0,
@ -154,9 +156,24 @@
}, 2000) }, 2000)
}, },
onReady() {
onLoad() { //(IOS)
uni.getNetworkType({
success: function (res) {
console.log(res.networkType);// wifi2g3g4gethernetunknownnone
if(res.networkType === "none"){
this.typee = 1;
console.log("当前无网络",this.typee);
}else{
this.typee = 2
console.log("有网络",this.typee);
}
}
});
},
onLoad() {
let home = 'HOME' let home = 'HOME'
this.getIndex(home) this.getIndex(home)
this.isLogin = uni.getStorageSync('isLogin') this.isLogin = uni.getStorageSync('isLogin')
@ -201,7 +218,7 @@
}, },
onShow() { onShow() {
this.isLogin = uni.getStorageSync('isLogin') this.isLogin = uni.getStorageSync('isLogin')
console.log(this.isLogin) // console.log(this.isLogin)
uni.hideTabBar() uni.hideTabBar()
this.getList() this.getList()
this.getMes() this.getMes()
@ -291,7 +308,7 @@
}, },
openClose() { openClose() {
console.log(11) // console.log(11)
this.countdownTime2 = 0 this.countdownTime2 = 0
//uni.showTabBar() //uni.showTabBar()
uni.setTabBarStyle({ uni.setTabBarStyle({
@ -306,7 +323,7 @@
//uni.showTabBar() //uni.showTabBar()
}, },
onReachBottom(e) { onReachBottom(e) {
console.log(111) // console.log(111)
this.bootom = 1 this.bootom = 1
}, },
getimgheight1(item) { getimgheight1(item) {
@ -339,10 +356,9 @@
let img let img
let url let url
if (res.error == 0) { if (res.error == 0) {
console.log(res.data.zones) // console.log(res.data.zones)
if (res.data.zones) { if (res.data.zones) {
res.data.zones.map(item => { res.data.zones.map(item => {
if (item.zone_code == "KAIPIN") { if (item.zone_code == "KAIPIN") {
if (item.blocks) { if (item.blocks) {
@ -1328,24 +1344,26 @@
<!-- HOT SELLS 2 --> <!-- HOT SELLS 2 -->
<scroll-view class="spike1 page_padding" scroll-x="true" :show-scrollbar="false" <scroll-view class="spike1 page_padding" scroll-x="true" @change="handlechange" :show-scrollbar="false"
v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'"> :indicator-dots="true" :circular="true" :interval="3000" :duration="1000"
v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" :current="mycurrent">
<view class="spike1_item padding_honlist2" v-for="(item1,index1) in item.blocks" <view class="spike1_item padding_honlist2" v-for="(item1,index1) in item.blocks"
:key="item1.block_id"> :key="item1.block_id">
<view :class="['swiper-item',index==mycurrent ? 'active' : ''], item_img" > <view :class="['swiper-item',index1==mycurrent ? 'active' : '']" >
<!-- class="item_img"> --> <!-- class="item_img"> -->
<image :src="item1.block_pic" mode="" <image :src="item1.block_pic" mode=""
:style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}" :style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}"
@click="imgTo(item1)"></image> @click="imgTo(itesm1)"></image>
</view> </view>
</view> </view>
<!-- 轮播图 --> <!-- 轮播图 -->
<!-- <view> <!-- <view v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" :current="mycurrent">
<swiper style="height: 600rpx;" previous-margin="140rpx" next-margin="140rpx" @change="handlechange" :current="mycurrent" :indicator-dots="true" :circular="true" :interval="3000" :duration="1000"> <swiper v-for="(item1,index1) in item.blocks" :key="item1.block_id" style="height: 600rpx;" previous-margin="140rpx" next-margin="140rpx" @change="handlechange" :current="mycurrent" :indicator-dots="true" :circular="true" :interval="3000" :duration="1000">
<swiper-item v-for="i,index in 10" :key="i"> <swiper-item v-for="i,index in 10" :key="i">
<view :class="['swiper-item',index==mycurrent ? 'active' : '']"> <view :class="['swiper-items',index==mycurrent ? 'active' : '']">
<img src="https://s2.loli.net/2022/05/11/rHeUj2V7pWg6MyQ.jpg" style="width: 100%;height: 100%;" alt="" srcset=""> <image :src="item1.block_pic" mode=""
:style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}"
@click="imgTo(itesm1)"></image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -1809,7 +1827,7 @@
background-color: #000000; background-color: #000000;
position: fixed; position: fixed;
top: 0; top: 0;
z-index: 99999999; z-index: 99;
// opacity: 0.8; // opacity: 0.8;
// height: 260rpx; // height: 260rpx;
width: 100%; width: 100%;
@ -2491,7 +2509,7 @@
width: 100%; width: 100%;
top: 0; top: 0;
color: white; color: white;
z-index: 999; z-index: 9999999;
position: fixed; position: fixed;
// padding-top: 50rpx; // padding-top: 50rpx;

616
pages/index/index2.vue

File diff suppressed because it is too large

589
pages/order/confirmation.vue

File diff suppressed because it is too large

263
pages/order/details.vue

@ -37,7 +37,7 @@
<view class="cancelled toPaid" v-if="details_index==0"> <view class="cancelled toPaid" v-if="details_index==0">
<view class="cancelled_left"> <view class="cancelled_left">
<view > <view>
<text class="shipped_right_text">Waiting for payment</text> <text class="shipped_right_text">Waiting for payment</text>
<view>The timeout order will be closed automatically</view> <view>The timeout order will be closed automatically</view>
</view> </view>
@ -49,7 +49,7 @@
</view> </view>
<view class="cancelled transit" @click="goLogistics" v-if="details_index==2"> <view class="cancelled transit" @click="goLogistics" v-if="details_index==2">
<view class="cancelled_left" > <view class="cancelled_left">
<image src="../../static/img/transit.png" mode=""></image> <image src="../../static/img/transit.png" mode=""></image>
<view class="cancelled_left_info"> <view class="cancelled_left_info">
<view class="shipped_right_text">New YorkHas arrived statesHas arrived states</view> <view class="shipped_right_text">New YorkHas arrived statesHas arrived states</view>
@ -72,7 +72,7 @@
</view> </view>
<view class="address_content"> <view class="address_content">
<text>{{goodsDate.sign_building}}</text> <text>{{goodsDate.sign_building}}</text>
<view >{{goodsDate.address_detail}}</view> <view>{{goodsDate.address_detail}}</view>
</view> </view>
</view> </view>
<!-- <image src="../../static/img/right.png" class="address_more"></image> --> <!-- <image src="../../static/img/right.png" class="address_more"></image> -->
@ -175,8 +175,10 @@
<view class="details_footer" v-if="details_index!=1"> <view class="details_footer" v-if="details_index!=1">
<button class="white" v-if=" details_index==2||details_index==3" @click="goLogistics">LOGISTICS</button> <button class="white" v-if=" details_index==2||details_index==3" @click="goLogistics">LOGISTICS</button>
<button class="white" v-if="details_index==4 || details_index==3" @click.stop="openTips(1)">DELETE ORDER</button> <button class="white" v-if="details_index==4 || details_index==3" @click.stop="openTips(1)">DELETE
<button class="black" v-if="details_index==3 && goodsDate.comment_status_code==0" @click="goComment()">COMMENT</button> ORDER</button>
<button class="black" v-if="details_index==3 && goodsDate.comment_status_code==0"
@click="goComment()">COMMENT</button>
<button class="white" v-if="details_index==0 " @click.stop="openTips(0)">CANCEL ORDER</button> <button class="white" v-if="details_index==0 " @click.stop="openTips(0)">CANCEL ORDER</button>
<button class="black" v-if="details_index==0" @click="isPay=true">PAY NOW</button> <button class="black" v-if="details_index==0" @click="isPay=true">PAY NOW</button>
@ -193,24 +195,26 @@
</text> </text>
<image src="../../static/img/close1.png" mode="" @click="isPay=false"></image> <image src="../../static/img/close1.png" mode="" @click="isPay=false"></image>
</view> </view>
<view class="order_popup_pay" > <view class="order_popup_pay">
<view class="pay_item" @click="selectPay(0)"> <view class="pay_item" @click="selectPay(0)">
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==0"></image> <image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==0">
</image>
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> <image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image>
<view class="pay_item_right"> <view class="pay_item_right">
<image src="../../static/img/pay_pal.png" mode=""></image> <image src="../../static/img/pay_pal.png" mode=""></image>
<text>Pay Pal</text> <text>Pay Pal</text>
</view> </view>
</view> </view>
<!-- <view class="pay_item" @click="selectPay(1)"> <view class="pay_item" @click="selectPay(1)">
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==1"></image> <image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==1">
</image>
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> <image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image>
<view class="pay_item_right"> <view class="pay_item_right">
<image src="../../static/img/card.png" mode=""></image> <image src="../../static/img/card.png" mode=""></image>
<text>Credit/Debit Card</text> <text>Credit/Debit Card</text>
</view> </view>
</view> </view>
<view class="pay_item" @click="selectPay(2)"> <!-- <view class="pay_item" @click="selectPay(2)">
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==2"></image> <image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==2"></image>
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> <image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image>
<view class="pay_item_right"> <view class="pay_item_right">
@ -231,145 +235,171 @@
</view> </view>
<!-- 删除取消弹框 --> <!-- 删除取消弹框 -->
<uni-popup ref="alertDialog" type="dialog"> <uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="error" cancelText="Close" :confirmText="tipsBut" title="Tips" :content="tipsInfo" @confirm="dialogConfirm" ></uni-popup-dialog> <uni-popup-dialog type="error" cancelText="Close" :confirmText="tipsBut" title="Tips" :content="tipsInfo"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import {defaultRequest2} from '../../api/index.js' import {
defaultRequest2
} from '../../api/index.js'
export default { export default {
data() { data() {
return { return {
// 0 1 2 3 4 () // 0 1 2 3 4 ()
// 0 1 2 3 4 // 0 1 2 3 4
details_index:4, details_index: 4,
query:{ query: {
_action:'getorder', _action: 'getorder',
order_id:'', order_id: '',
order_sn:'' order_sn: ''
}, },
goodsDate:{}, goodsDate: {},
goods_list:[], goods_list: [],
isPay:false, isPay: false,
payQuery:{ payQuery: {
_action:'payorder', _action: 'payorder',
order_id:'', order_id: '',
order_type:'GOODSBUY', order_type: 'GOODSBUY',
payment_method:'alipay.native' payment_method: 'alipay.native'
}, },
pay_index:0, pay_index: 0,
logisticsinfo:{}, logisticsinfo: {},
// 0 1 2 // 0 1 2
tipsType:0, tipsType: 0,
tipsInfo:'', tipsInfo: '',
tipsBut:'', tipsBut: '',
cancelQuery:{ cancelQuery: {
_action:'cancelorder', _action: 'cancelorder',
order_id:'' order_id: ''
}, },
} }
}, },
methods:{ methods: {
// //
goDetails(id){ goDetails(id) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/productDetails/index?goodid='+id url: '/pages/productDetails/index?goodid=' + id
}) })
}, },
// //
goComment(){ goComment() {
let data=this.goodsDate let data = this.goodsDate
data.order_goods=this.goods_list data.order_goods = this.goods_list
uni.navigateTo({ uni.navigateTo({
url:'../productDetails/review?data='+JSON.stringify(data) url: '../productDetails/review?data=' + JSON.stringify(data)
}) })
}, },
// //
openTips(type){ openTips(type) {
this.tipsType=type this.tipsType = type
if(type==0){ if (type == 0) {
this.tipsInfo='Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation' this.tipsInfo =
this.tipsBut='CancelOrder' 'Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation'
this.cancelQuery._action='cancelorder' this.tipsBut = 'CancelOrder'
}else if(type==1){ this.cancelQuery._action = 'cancelorder'
this.tipsInfo='Are you sure you want to delete this order?' } else if (type == 1) {
this.tipsBut='DeleteOrder' this.tipsInfo = 'Are you sure you want to delete this order?'
this.cancelQuery._action='deleteorder' this.tipsBut = 'DeleteOrder'
}else if(type==2){ this.cancelQuery._action = 'deleteorder'
this.tipsInfo='Are you sure you have received the products?' } else if (type == 2) {
this.tipsBut='Confirm' this.tipsInfo = 'Are you sure you have received the products?'
this.cancelQuery._action='affirmorder' this.tipsBut = 'Confirm'
this.cancelQuery._action = 'affirmorder'
} }
this.$refs.alertDialog.open() this.$refs.alertDialog.open()
}, },
// //
dialogConfirm(){ dialogConfirm() {
defaultRequest2(this.cancelQuery).then(res=>{ defaultRequest2(this.cancelQuery).then(res => {
console.info(res) console.info(res)
if(res.error==0){ if (res.error == 0) {
if(this.tipsType==0){ if (this.tipsType == 0) {
this.details_index=4 this.details_index = 4
}else if(this.tipsType==1){ } else if (this.tipsType == 1) {
uni.navigateBack() uni.navigateBack()
}else{ } else {
this.details_index=3 this.details_index = 3
} }
this.getList() this.getList()
} }
}) })
}, },
goLogistics(){ goLogistics() {
uni.navigateTo({ uni.navigateTo({
url:'./logisticsDetails?order_id='+this.goodsDate.order_id url: './logisticsDetails?order_id=' + this.goodsDate.order_id
}) })
}, },
// //
selectPay(index){ selectPay(index) {
this.pay_index=index this.pay_index = index
}, },
// //
getPayDate(){ getPayDate() {
console.log(this.pay_index) console.log(this.pay_index)
if(this.pay_index == 0){ if (this.pay_index == 0) {
let data ={_action:'payorder',order_id:this.payQuery.order_id,order_type:'GOODSBUY',payment_method:'paypal'} let data = {
defaultRequest2(data).then(res=>{ _action: 'payorder',
order_id: this.payQuery.order_id,
order_type: 'GOODSBUY',
payment_method: 'paypal'
}
defaultRequest2(data).then(res => {
console.info(data) console.info(data)
console.log(res) console.log(res)
if(res.error == 0){ if (res.error == 0) {
if(res.data.need_pay_amount==0) return if (res.data.need_pay_amount == 0) return
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) // plus.runtime.openURL(res.data.prepay_data.checkoutnow_url)
// this.src = res.data.prepay_data.checkoutnow_url // this.src = res.data.prepay_data.checkoutnow_url
uni.navigateTo({ uni.navigateTo({
url:'./paypalWebview?src='+res.data.prepay_data.checkoutnow_url url: './paypalWebview?src=' + res.data.prepay_data.checkoutnow_url
}) })
} }
}) })
} else if(this.pay_index == 1) {
let data = {
_action: 'payorder',
order_id: this.payQuery.order_id,
order_type: 'GOODSBUY',
payment_method: 'oceanpay'
}
defaultRequest2(data).then(res => {
console.info(data)
console.log(res)
if (res.error == 0) {
if (res.data.need_pay_amount == 0) return
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url)
// this.src = res.data.prepay_data.checkoutnow_url
uni.navigateTo({
url: './paypalWebview?src=' + res.data.prepay_data.checkoutnow_url
})
} }
else{ })
console.info(this.payQuery,'支付宝') } else {
defaultRequest2(this.payQuery).then(res=>{ console.info(this.payQuery, '支付宝')
console.info(res,'支付宝') defaultRequest2(this.payQuery).then(res => {
if(res.error==0){ console.info(res, '支付宝')
if (res.error == 0) {
// //
if(res.data.need_pay_amount==0) return if (res.data.need_pay_amount == 0) return
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', provider: 'alipay',
orderInfo: res.data.prepay_data.order_info, // orderInfo: res.data.prepay_data.order_info, //
success: function (res) { success: function(res) {
console.log('success:' + JSON.stringify(res)); console.log('success:' + JSON.stringify(res));
uni.redirectTo({ uni.redirectTo({
url: 'paySuccess?order_id='+this.payQuery.order_id url: 'paySuccess?order_id=' + this.payQuery.order_id
}); });
}, },
fail: function (err) { fail: function(err) {
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
uni.showToast({ uni.showToast({
title:'Payment failed', title: 'Payment failed',
icon:'none' icon: 'none'
}) })
} }
}); });
@ -377,57 +407,61 @@
}) })
} }
}, },
payNow(id){ payNow(id) {
this.payQuery.order_id=id this.payQuery.order_id = id
this.isPay=true this.isPay = true
}, },
getDate(){ getDate() {
defaultRequest2(this.query).then(res=>{ defaultRequest2(this.query).then(res => {
console.info(res) console.info(res)
if(res.error==0){ if (res.error == 0) {
this.goodsDate=res.data this.goodsDate = res.data
this.goods_list=res.goods_list this.goods_list = res.goods_list
if(this.details_index==4){ if (this.details_index == 4) {
this.getLogistics() this.getLogistics()
} }
} }
}) })
}, },
getLogistics(){ getLogistics() {
let data ={_action:'getlogisticsinfo',order_id:this.goodsDate.order_id,order_sn:''} let data = {
defaultRequest2(data).then(res=>{ _action: 'getlogisticsinfo',
order_id: this.goodsDate.order_id,
order_sn: ''
}
defaultRequest2(data).then(res => {
console.info(res) console.info(res)
if(res.error==0){ if (res.error == 0) {
this.logisticsinfo=res.data[0] this.logisticsinfo = res.data[0]
} }
}) })
}, },
// //
Copy(e){ Copy(e) {
console.log(e) console.log(e)
uni.setClipboardData({ uni.setClipboardData({
data:e, data: e,
success:()=>{ success: () => {
uni.showToast({ uni.showToast({
title:'ok!', title: 'ok!',
icon:'none' icon: 'none'
}) })
} }
}) })
} }
}, },
onLoad(e){ onLoad(e) {
console.info(e) console.info(e)
this.details_index=e.details_index this.details_index = e.details_index
this.query.order_id=e.id this.query.order_id = e.id
this.cancelQuery.order_id=e.id this.cancelQuery.order_id = e.id
this.payQuery.order_id = e.id this.payQuery.order_id = e.id
this.getDate() this.getDate()
}, },
filters:{ filters: {
goodsAttr(e){ goodsAttr(e) {
return e.replace(/\s\n/g,';'); return e.replace(/\s\n/g, ';');
} }
} }
} }
@ -435,11 +469,10 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/common/scss/order.scss"; @import "@/common/scss/order.scss";
page{
} page {}
.body{
.body {
padding-bottom: 130rpx; padding-bottom: 130rpx;
} }
</style> </style>

28
project.config.json

@ -0,0 +1,28 @@
{
"appid": "wxd0df8d643cab9cca",
"compileType": "miniprogram",
"libVersion": "2.27.3",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}

7
project.private.config.json

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "s",
"setting": {
"compileHotReLoad": true
}
}
Loading…
Cancel
Save