|
|
@@ -405,98 +405,96 @@ export default {
|
|
|
console.log(this.couponText)
|
|
|
}).catch(err => {})
|
|
|
},
|
|
|
- getGhsData(id) {
|
|
|
- getGhsDataApi({id:id}).then(res => {
|
|
|
- this.ghsMsg = res.data;
|
|
|
- console.log('res.data',this.ghsMsg)
|
|
|
- this.purchaseFreight(this.ghsMsg);
|
|
|
- });
|
|
|
- },
|
|
|
- countAllPrices(e){
|
|
|
- this.allPrices = this.allPrices+Number(this.form.sendCost)
|
|
|
- console.log('e',e)
|
|
|
- console.log('this.form.sendCost',Number(this.form.sendCost))
|
|
|
- console.log('this.form.sendCost',this.form.sendCost)
|
|
|
- console.log('this.allPrices',this.allPrices)
|
|
|
- },
|
|
|
-
|
|
|
- // api
|
|
|
- _getDet() {
|
|
|
- let data = uni.getStorageSync("modifyShopB");
|
|
|
- if (this.$util.isEmpty(data)) return;
|
|
|
- Object.keys(this.form).forEach((i, index) => {
|
|
|
- // if (i != 'password') {
|
|
|
- this.form[i] = data[i];
|
|
|
- // }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- purchaseFreight(info) {
|
|
|
- const product = this.selectList.map(ele => {
|
|
|
- return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
|
|
|
- });
|
|
|
- let params = {
|
|
|
- ghsId: this.options.id,
|
|
|
- product: JSON.stringify(product),
|
|
|
- province: info.province,
|
|
|
- city:info.city,
|
|
|
- address:info.address,
|
|
|
- floor:info.floor,
|
|
|
- long: info.long,
|
|
|
- lat: info.lat,
|
|
|
- sendTime: this.sendTime,
|
|
|
- };
|
|
|
- freight(params).then(res => {
|
|
|
- this.form.sendCost = res.data.sedCost;
|
|
|
- });
|
|
|
- },
|
|
|
- confirmFn(options) {
|
|
|
- createOrder(options).then(res => {
|
|
|
- // this.$msg("下单成功");
|
|
|
- this.resetSelectInfoByType(this.pageType);
|
|
|
- const {
|
|
|
- data: { id, orderSn }
|
|
|
- } = res;
|
|
|
- let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
|
|
|
- uni.redirectTo({
|
|
|
- url: url,
|
|
|
- success: result => {},
|
|
|
- fail: () => {},
|
|
|
- complete: () => {}
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- affirmFormSubmit(){
|
|
|
- const product = this.list.map(ele => {
|
|
|
- return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
|
|
|
+ getGhsData(id) {
|
|
|
+ getGhsDataApi({id:id}).then(res => {
|
|
|
+ this.ghsMsg = res.data;
|
|
|
+ console.log('res.data',this.ghsMsg)
|
|
|
+ this.purchaseFreight(this.ghsMsg);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ countAllPrices(e){
|
|
|
+ this.allPrices = this.allPrices+Number(this.form.sendCost)
|
|
|
+ console.log('e',e)
|
|
|
+ console.log('this.form.sendCost',Number(this.form.sendCost))
|
|
|
+ console.log('this.form.sendCost',this.form.sendCost)
|
|
|
+ console.log('this.allPrices',this.allPrices)
|
|
|
+ },
|
|
|
+ _getDet() {
|
|
|
+ let data = uni.getStorageSync("modifyShopB");
|
|
|
+ if (this.$util.isEmpty(data)) return;
|
|
|
+ Object.keys(this.form).forEach((i, index) => {
|
|
|
+ this.form[i] = data[i];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ purchaseFreight(info) {
|
|
|
+ const product = this.selectList.map(ele => {
|
|
|
+ return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
|
|
|
+ });
|
|
|
+ let params = {
|
|
|
+ ghsId: this.options.id,
|
|
|
+ product: JSON.stringify(product),
|
|
|
+ province: info.province,
|
|
|
+ city:info.city,
|
|
|
+ address:info.address,
|
|
|
+ floor:info.floor,
|
|
|
+ long: info.long,
|
|
|
+ lat: info.lat,
|
|
|
+ sendTime: this.sendTime,
|
|
|
+ };
|
|
|
+ freight(params).then(res => {
|
|
|
+ this.form.sendCost = res.data.sedCost;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ confirmFn(options) {
|
|
|
+ createOrder(options).then(res => {
|
|
|
+ this.resetSelectInfoByType(this.pageType);
|
|
|
+ const {
|
|
|
+ data: { id, orderSn }
|
|
|
+ } = res;
|
|
|
+ let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
|
|
|
+ uni.redirectTo({
|
|
|
+ url: url,
|
|
|
+ success: result => {},
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
});
|
|
|
- let parameter = {
|
|
|
- getType:this.form.sendType,
|
|
|
- sendTime:this.sendTime,
|
|
|
- sendCost:this.form.sendType==2?'':this.form.sendCost,
|
|
|
- remark:this.remark,
|
|
|
- product:JSON.stringify(product),
|
|
|
- ghsId:this.ghsMsg.id,
|
|
|
- couponId: this.form.couponId
|
|
|
- }
|
|
|
- let self = this;
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确认提交?',
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- createOrder(parameter).then(res => {
|
|
|
- const {data: { orderSn,realPrice,count,hasDebtPay }} = res;
|
|
|
- self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}&hasDebtPay=${hasDebtPay}`, type: 2})
|
|
|
- setTimeout(() => {
|
|
|
- uni.removeStorageSync('selectCouponInfo')
|
|
|
- self.resetSelectInfoByType(self.pageType);
|
|
|
- }, 600)
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ affirmFormSubmit(){
|
|
|
+ const product = this.list.map(ele => {
|
|
|
+ return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
|
|
|
+ });
|
|
|
+ let xj = uni.getStorageSync("ghsXj"+this.ghsMsg.id)
|
|
|
+ let params = {
|
|
|
+ getType:this.form.sendType,
|
|
|
+ sendTime:this.sendTime,
|
|
|
+ sendCost:this.form.sendType==2?'':this.form.sendCost,
|
|
|
+ remark:this.remark,
|
|
|
+ product:JSON.stringify(product),
|
|
|
+ ghsId:this.ghsMsg.id,
|
|
|
+ couponId: this.form.couponId,
|
|
|
+ xj:JSON.stringify(xj)
|
|
|
+ }
|
|
|
+ let self = this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认提交?',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ createOrder(params).then(res => {
|
|
|
+ const {data: { orderSn,realPrice,count,hasDebtPay }} = res;
|
|
|
+ self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}&hasDebtPay=${hasDebtPay}`, type: 2})
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.removeStorageSync('selectCouponInfo')
|
|
|
+ self.resetSelectInfoByType(self.pageType);
|
|
|
+ //删除小菊的记忆
|
|
|
+ uni.removeStorageSync("ghsXj"+params.ghsId)
|
|
|
+ }, 600)
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
numberAdd(arg1, arg2) {
|
|
|
var r1, r2, m, n;
|
|
|
try {
|