Browse Source

预下单

dev_des
1054425342@qq.com 1 month ago
parent
commit
42149b1d87
  1. 25
      package-lock.json
  2. 3
      package.json
  3. 15
      static/js/request.js
  4. 1487
      subPackages/points/index.vue
  5. 23
      subPackages/techan/detail.vue
  6. 1278
      subPackages/techan/order - 副本.vue
  7. 3159
      subPackages/techan/order.vue
  8. 3
      subPackages/user/gwc.vue

25
package-lock.json

@ -9,10 +9,21 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"decimal.js": "^10.6.0",
"js-md5": "^0.8.3",
"moment": "^2.30.1",
"ydui-district": "^1.1.0"
},
"devDependencies": {}
}
},
"node_modules/decimal.js": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg=="
},
"node_modules/js-md5": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.8.3.tgz",
"integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ=="
},
"node_modules/moment": {
"version": "2.30.1",
@ -29,6 +40,16 @@
}
},
"dependencies": {
"decimal.js": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg=="
},
"js-md5": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.8.3.tgz",
"integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ=="
},
"moment": {
"version": "2.30.1",
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",

3
package.json

@ -4,10 +4,11 @@
"description": "",
"main": "main.js",
"dependencies": {
"decimal.js": "^10.6.0",
"js-md5": "^0.8.3",
"moment": "^2.30.1",
"ydui-district": "^1.1.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},

15
static/js/request.js

@ -1,6 +1,6 @@
import Vue from 'vue';
import store from '@/store';
import md5 from 'js-md5';
// 定义 API URL
const DEV_API_URL = 'http://1.13.193.49';
// const DEV_API_URL = 'https://epic.js-dyyj.com';
@ -81,6 +81,16 @@ Vue.prototype.Post = (params = {}, apiurl,customUrl) => {
uni.showLoading({
title: '加载中'
});
let userID = ''
const userInfoFromStorage = uni.getStorageSync('userInfo');
if (userInfoFromStorage) {
const userInfo = JSON.parse(userInfoFromStorage);
if (userInfo.id) {
userID = userInfo.id.toString();
}
}
let time = new Date().getTime()
let sign = userID+ time
uni.request({
method: params.method || 'GET',
url:baseUrl + apiurl,
@ -89,9 +99,10 @@ Vue.prototype.Post = (params = {}, apiurl,customUrl) => {
'content-type': 'application/json',
'token': token || '',
'userId': getUserId() || '',
'sign':md5(md5(sign.toString())),
'timestamp':time
},
success: (res) => {
console.log('success', res.data);
uni.hideLoading()
if (res.data.code === 200 || res.data.code === 1) {
resolve(res.data);

1487
subPackages/points/index.vue

File diff suppressed because it is too large

23
subPackages/techan/detail.vue

@ -288,22 +288,17 @@
}
},
order(item) {
order() {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
let orderInfo = {
// is_post: goods.is_post || "2",
is_post: 1,
goods: [{goodsInfo: this.info, skuInfo: goods }],
post: 0,
}
uni.setStorageSync('teChanOrder', JSON.stringify(orderInfo)); //
// uni.setStorageSync('teChanInfo', JSON.stringify(this.info)); //
uni.navigateTo({
url: '/subPackages/techan/order'
});
let list = [{
...goods,
specUrl:goods.imageUrl,
goodsName:this.info.goodsName,
quantity:goods.buyNum
}]
this.$store.commit("changeOrderSCart", list);
this.gotoPath("/subPackages/techan/order");
},
addToCart () {
let goods = this.sku[this.productIndex]

1278
subPackages/techan/order - 副本.vue

File diff suppressed because it is too large

3159
subPackages/techan/order.vue

File diff suppressed because it is too large

3
subPackages/user/gwc.vue

@ -374,7 +374,8 @@
.then((res) => {
if (res.data.canOrder) {
this.$store.commit("changeOrderSCart", list);
this.gotoPath("/subPackages/order/gwcOrder");
this.gotoPath("/subPackages/techan/order");
} else {
uni.showToast({
title: res.message,

Loading…
Cancel
Save