bug fix
This commit is contained in:
131
pages/my/apply_after_sales/apply_after_sales.js
Normal file
131
pages/my/apply_after_sales/apply_after_sales.js
Normal file
@ -0,0 +1,131 @@
|
||||
// pages/my/apply_after_sales/apply_after_sales.js
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
order: null,
|
||||
orderId: null,
|
||||
goodsNames: [],
|
||||
packages: [{
|
||||
id: 1,
|
||||
goods: [],
|
||||
logisticsNumber: "YT7460149632645"
|
||||
}]
|
||||
},
|
||||
addPackage() {
|
||||
const _packages = this.data.packages
|
||||
_packages.push({
|
||||
id: Date.now(),
|
||||
goods: [],
|
||||
logisticsNumber: ""
|
||||
})
|
||||
this.setData({
|
||||
packages: _packages
|
||||
})
|
||||
},
|
||||
deletePackage(e) {
|
||||
const { id } = e.currentTarget.dataset
|
||||
console.log(id);
|
||||
this.setData({
|
||||
packages: this.data.packages.filter(el => el.id !== id)
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { id, sq, num } = options
|
||||
console.log(options);
|
||||
this.setData({
|
||||
orderId: id
|
||||
})
|
||||
|
||||
wx.setNavigationBarTitle({
|
||||
title: sq == 1 ? '退货申请' : '换货申请'
|
||||
})
|
||||
|
||||
wx.showLoading({
|
||||
title: '加载中..',
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/order/getOrderDetail',
|
||||
method: 'GET',
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {
|
||||
userId: app.globalData.userId,
|
||||
orderNumber: num,
|
||||
},
|
||||
success: res => {
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
let order = res.data.value;
|
||||
this.setData({
|
||||
order,
|
||||
goodsNames: order.goodsList.map(el => `${el.goodsName} - ${el.wisdGoodsSpec.specName} × ${el.goodsNum}`)
|
||||
// package: goods.logistics ? JSON.parse(goods.logistics).find(el => el.id == this.data.packageId) : null
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
3
pages/my/apply_after_sales/apply_after_sales.json
Normal file
3
pages/my/apply_after_sales/apply_after_sales.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
16
pages/my/apply_after_sales/apply_after_sales.wxml
Normal file
16
pages/my/apply_after_sales/apply_after_sales.wxml
Normal file
@ -0,0 +1,16 @@
|
||||
<!--pages/my/apply_after_sales/apply_after_sales.wxml-->
|
||||
<view>
|
||||
<view wx:for="{{packages}}" wx:key="id" class="package-card">
|
||||
<view wx:if="{{packages.length>1}}" data-id="{{item.id}}" bind:tap="deletePackage" style="width: 36rpx;height: 36rpx;position: absolute;top: -18rpx;right: -18rpx;background-color: red;border-radius: 50%;font-size: 36rpx;display: flex;justify-content: center;align-items: center;color: white;">×</view>
|
||||
<view class="package-index">包裹{{index+1}}</view>
|
||||
<text class="form-label">快递单号</text>
|
||||
<input class="package-input" placeholder="请输入快递单号" />
|
||||
<picker range="{{goodsNames}}" class="add-goods">
|
||||
<button size="mini" type="primary">添加商品</button>
|
||||
<!-- <view class="">添加商品</view> -->
|
||||
</picker>
|
||||
</view>
|
||||
<view class="display_J_C" style="margin-top: 24rpx;">
|
||||
<button size="mini" type="primary" bind:tap="addPackage">添加包裹</button>
|
||||
</view>
|
||||
</view>
|
46
pages/my/apply_after_sales/apply_after_sales.wxss
Normal file
46
pages/my/apply_after_sales/apply_after_sales.wxss
Normal file
@ -0,0 +1,46 @@
|
||||
/* pages/my/apply_after_sales/apply_after_sales.wxss */
|
||||
page {
|
||||
background-color: rgb(245, 245, 245);
|
||||
}
|
||||
.package-card {
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
/* border: 1rpx solid rgb(151, 151, 151); */
|
||||
margin: 20rpx 20rpx 0;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
||||
padding: 20rpx;
|
||||
}
|
||||
.package-card:not(:first-of-type) {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.package-card .add-goods {
|
||||
margin-top: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.package-card .package-index {
|
||||
position: absolute;
|
||||
top: -16rpx;
|
||||
left: 40rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 0 8rpx;
|
||||
background-color: linear-gradient(
|
||||
to bottom,
|
||||
rgba(255, 255, 255, 0) 50%,
|
||||
rgba(255, 255, 255, 1) 50%
|
||||
);
|
||||
}
|
||||
.package-card .form-label {
|
||||
font-size: 28rpx;
|
||||
color: gray;
|
||||
}
|
||||
.package-card .package-input {
|
||||
margin-top: 6rpx;
|
||||
border: 1rpx solid rgb(225, 225, 225);
|
||||
height: 50rpx;
|
||||
padding: 0 12rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
Reference in New Issue
Block a user