소스 검색

Merge branch 'master' of hyq/kmall-pt into master

黄亚琴 6 년 전
부모
커밋
209b1b3beb

+ 119 - 0
wx-mall/pages/ucenter/applyRefund/applyRefund.js

@@ -0,0 +1,119 @@
+var util = require('../../../utils/util.js');
+var api = require('../../../config/api.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    refundMoney: '',
+    orderGoods: [],
+    orderId: '',
+    merchOrderSn: ''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 页面初始化 options为页面跳转所带来的参数
+    this.setData({
+      orderId: options.orderId,
+      merchOrderSn: options.merchOrderSn,
+      refundMoney: options.refundMoney
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    let that = this;
+    util.request(api.OrderDetail, {
+      orderId: that.data.orderId
+    }).then(function (res) {
+      if (res.errno === 0) {
+        that.setData({
+          orderGoods: res.data.orderGoods
+        });
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+  saveApplyRefund: function (e) {
+    if (!e.detail.value.refundReason) {
+      util.showErrorToast('退款原因不能为空');
+      return false;
+    }
+
+    let that = this; console.log(that.data.merchOrderSn);
+    util.request(api.saveApplyRefund, {
+      refundReason: e.detail.value.refundReason,
+      orderId: that.data.orderId,
+      merchOrderSn: that.data.merchOrderSn
+    }, 'POST').then(function (res) {
+      if (res.errno === 0) {
+        //成功提示
+        wx.showModal({
+          title: '',
+          content: res.errmsg,
+          showCancel: false,
+          success: function (res) {
+            if (res.confirm) {
+              wx.navigateTo({
+                url: '/pages/ucenter/order/order?tabIndex=2'
+              });
+            }
+          }
+        });
+      } else {
+        wx.showModal({
+          title: '',
+          content: res.errmsg,
+          showCancel: false
+        });
+      }
+    });
+  },
+})

+ 2 - 0
wx-mall/pages/ucenter/applyRefund/applyRefund.json

@@ -0,0 +1,2 @@
+{
+  "navigationBarTitleText": "申请退款"}

+ 25 - 0
wx-mall/pages/ucenter/applyRefund/applyRefund.wxml

@@ -0,0 +1,25 @@
+<!--pages/ucenter/applyRefund/applyRefund.wxml-->
+<form bindsubmit="saveApplyRefund" report-submit='true'>
+  <view class="apply-refund">
+    <view class="add-form">
+      <view class="form-item-url" wx:for="{{orderGoods}}" wx:key="{{index}}" >
+          <image class="order-image" src="{{item.list_pic_url}}"></image>
+          <view class="name"><text style='font-size:26rpx;'>{{item.goods_name}}</text></view>
+          <view class="name2"><text style='font-size:26rpx;color: rgb(151, 150, 150);'>{{item.goods_specification_name_value}}</text></view>
+      </view>
+      <view class="form-item">
+        <label>退款原因:</label>
+        <input class="input" name='refundReason' placeholder="必填" auto-focus/>
+      </view>
+      <view class="form-item">
+        <label>退款金额:</label>
+        <text>¥{{refundMoney}}</text>
+      </view>
+    </view>
+
+    <view class="btns">
+      <button class="save" form-type="submit">提交申请</button>
+    </view>
+
+  </view>
+</form>

+ 221 - 0
wx-mall/pages/ucenter/applyRefund/applyRefund.wxss

@@ -0,0 +1,221 @@
+/* pages/ucenter/applyRefund/applyRefund.wxss */
+page {
+  height: 100%;
+  background: #f4f4f4;
+}
+
+.apply-refund .add-form {
+  background: #fff;
+  width: 100%;
+  height: auto;
+  overflow: hidden;
+}
+
+.apply-refund .form-item {
+  height: 116rpx;
+  padding-left: 31.25rpx;
+  border-bottom: 1px solid #d9d9d9;
+  display: flex;
+  align-items: center;
+  padding-right: 31.25rpx;
+}
+
+.apply-refund .form-item .location{
+ height: 60rpx;
+ width: 60rpx;
+}
+
+.apply-refund label {
+  width: 160rpx;
+  font-weight: bold;
+}
+
+.apply-refund .input {
+  flex: 1;
+  height: 44rpx;
+  line-height: 44rpx;
+  overflow: hidden;
+}
+
+.apply-refund .form-default {
+  border-bottom: 1px solid #d9d9d9;
+  height: 96rpx;
+  background: #fafafa;
+  padding-top: 28rpx;
+  font-size: 28rpx;
+}
+
+.default-input {
+  margin: 0 auto;
+  display: block;
+  width: 240rpx;
+  height: 40rpx;
+  padding-left: 50rpx;
+  line-height: 40rpx;
+  background: url(http://image.meiping123.com/upload/20180104/1039217652163c.png) 1rpx -448rpx no-repeat;
+  background-size: 38rpx 486rpx;
+  font-size: 28rpx;
+}
+
+.default-input.selected {
+  background: url(http://image.meiping123.com/upload/20180104/1039217652163c.png) 0 -192rpx no-repeat;
+  background-size: 38rpx 486rpx;
+}
+
+.apply-refund .btns {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+  display: flex;
+  height: 100rpx;
+  width: 100%;
+}
+
+.apply-refund .cannel, .apply-refund .save {
+  flex: 1;
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  color: #fff;
+  border: none;
+  border-radius: 0;
+}
+
+.apply-refund .cannel {
+  background: #333;
+}
+
+.apply-refund .save {
+  background: #b4282d;
+}
+
+.region-select {
+  width: 100%;
+  height: 600rpx;
+  background: #fff;
+  position: fixed;
+  z-index: 10;
+  left: 0;
+  bottom: 0;
+}
+
+.region-select .hd {
+  height: 108rpx;
+  width: 100%;
+  border-bottom: 1px solid #f4f4f4;
+  padding: 46rpx 30rpx 0 30rpx;
+}
+
+.region-select .region-selected {
+  float: left;
+  height: 60rpx;
+  display: flex;
+}
+
+.region-select .region-selected .item {
+  max-width: 140rpx;
+  margin-right: 30rpx;
+  text-align: left;
+  line-height: 60rpx;
+  height: 100%;
+  color: #333;
+  font-size: 28rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.region-select .region-selected .item.disabled {
+  color: #999;
+}
+
+.region-select .region-selected .item.selected {
+  color: #b4282d;
+}
+
+.region-select .done {
+  float: right;
+  height: 60rpx;
+  width: 60rpx;
+  border: none;
+  background: #fff;
+  line-height: 60rpx;
+  text-align: center;
+  color: #333;
+  font-size: 28rpx;
+}
+
+.region-select .done.disabled {
+  color: #999;
+}
+
+.region-select .bd {
+  height: 492rpx;
+  width: 100%;
+  padding: 0 30rpx;
+}
+
+.region-select .region-list {
+  height: auto;
+  overflow: scroll;
+}
+
+.region-select .region-list .item {
+  width: 100%;
+  height: 104rpx;
+  line-height: 104rpx;
+  text-align: left;
+  color: #333;
+  font-size: 28rpx;
+}
+
+.region-select .region-list .item.selected {
+  color: #b4282d;
+}
+
+.bg-mask {
+  height: 100%;
+  width: 100%;
+  background: rgba(0, 0, 0, 0.4);
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 8;
+}
+
+.id-card-txt{
+  font-size:22rpx;
+  margin-left: 20rpx;
+  color: #a5a3a3;
+}
+.order-image{
+  width: 130rpx;
+  height:130rpx;
+}
+.name{
+  height: 40rpx;
+  line-height: 40rpx;
+  font-size: 26rpx;
+  margin-left: 20rpx;
+  margin-bottom: 90rpx;
+}
+.name2{
+  height: 40rpx;
+  line-height: 40rpx;
+  font-size: 26rpx;
+  margin-left: 20rpx;
+  margin-bottom: 90rpx;
+  position: fixed;
+  top: 70rpx;
+  left: 160rpx;
+  z-index: 8;
+}
+.form-item-url {
+  height: 140rpx;
+  padding-left: 31.25rpx;
+  display: flex;
+  align-items: center;
+  padding-right: 31.25rpx;
+}