From dde0367716458ca889f5f8ff3f71cfe0b6470ab4 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Tue, 8 Oct 2019 14:58:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=AE=A2=E5=8D=95=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/User.php | 9 +- application/service/UeditorService.php | 6 +- public/appmini/old/alipay/app.js | 44 +- public/appmini/old/alipay/app.json | 6 +- public/appmini/old/alipay/pages/cart/cart.js | 4 +- .../user-orderaftersale-detail.acss | 150 ++++++ .../user-orderaftersale-detail.axml | 172 +++++++ .../user-orderaftersale-detail.js | 468 ++++++++++++++++++ .../user-orderaftersale-detail.json | 6 + .../user-orderaftersale.acss | 65 +++ .../user-orderaftersale.axml | 60 +++ .../user-orderaftersale.js | 248 ++++++++++ .../user-orderaftersale.json | 3 + public/appmini/old/alipay/pages/user/user.js | 2 +- .../user-orderaftersale.swan | 3 +- public/appmini/old/baidu/pages/user/user.js | 2 +- .../user-orderaftersale.wxml | 3 +- public/appmini/old/weixin/pages/user/user.js | 2 +- .../admin/default/css/orderaftersale.css | 2 +- 19 files changed, 1228 insertions(+), 27 deletions(-) create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.acss create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.axml create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.js create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.json create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale/user-orderaftersale.acss create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale/user-orderaftersale.axml create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale/user-orderaftersale.js create mode 100644 public/appmini/old/alipay/pages/user-orderaftersale/user-orderaftersale.json diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 62dc7edc3..3ce980736 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -95,7 +95,14 @@ class User extends Common $result = (new \base\AlipayAuth())->GetAuthCode(MyC('common_app_mini_alipay_appid'), $this->data_post['authcode']); if($result['status'] == 0) { - return DataReturn('授权登录成功', 0, $result['data']['user_id']); + // 先从数据库获取用户信息 + $user = UserService::AppUserInfoHandle(null, 'alipay_openid', $result['data']['user_id']); + if(empty($user)) + { + return DataReturn('授权登录成功', 0, ['is_alipay_user_exist'=>0, 'openid'=>$result['data']['user_id']]); + } + $user['is_alipay_user_exist'] = 1; + return DataReturn('授权成功', 0, $user); } return DataReturn($result['msg'], -100); } diff --git a/application/service/UeditorService.php b/application/service/UeditorService.php index d9c06a026..36fede9aa 100644 --- a/application/service/UeditorService.php +++ b/application/service/UeditorService.php @@ -98,11 +98,11 @@ class UeditorService return DataReturn('callback参数不合法', -1); } } - if(self::$current_result['state'] == 'SUCCESS') + if(isset(self::$current_result['state']) && self::$current_result['state'] != 'SUCCESS') { - return DataReturn('操作成功', 0, self::$current_result); + return DataReturn(self::$current_result['state'], -1); } - return DataReturn(self::$current_result['state'], -1); + return DataReturn('操作成功', 0, self::$current_result); } /** diff --git a/public/appmini/old/alipay/app.js b/public/appmini/old/alipay/app.js index 105acc6ee..eba27bd88 100644 --- a/public/appmini/old/alipay/app.js +++ b/public/appmini/old/alipay/app.js @@ -63,8 +63,8 @@ App({ // 请求地址 request_url: "{{request_url}}", - // request_url: 'http://tp5-dev.com/', - // request_url: 'http://test.shopxo.net/', + request_url: 'http://tp5-dev.com/', + request_url: 'http://test.shopxo.net/', // 基础信息 application_title: "{{application_title}}", @@ -197,7 +197,7 @@ App({ var user = this.get_user_cache_info(); if (user == false) { // 唤醒用户授权 - this.user_login(); + this.user_login(object, method); return false; } else { @@ -218,8 +218,10 @@ App({ /** * 用户授权 + * object 回调操作对象 + * method 回调操作对象的函数 */ - user_login() { + user_login(object, method) { var openid = my.getStorageSync({key: this.data.cache_user_login_key}); if ((openid.data || null) == null) { @@ -241,12 +243,32 @@ App({ success: res => { my.hideLoading(); if (res.data.code == 0) { - my.setStorageSync({ - key: $this.data.cache_user_login_key, - data: res.data.data - }); - - $this.login_to_auth(); + var data = res.data.data; + if((data.is_alipay_user_exist || 0) == 1) + { + my.setStorage({ + key: $this.data.cache_user_info_key, + data: data, + success: (res) => { + if (typeof object === 'object' && (method || null) != null) { + object[method](); + } + }, + fail: () => { + my.showToast({ + type: "fail", + content: "用户信息缓存失败", + duration: 3000 + }); + } + }); + } else { + my.setStorageSync({ + key: $this.data.cache_user_login_key, + data: res.data.data.openid + }); + $this.login_to_auth(); + } } else { my.showToast({ type: "fail", @@ -309,7 +331,7 @@ App({ var openid = my.getStorageSync({key: this.data.cache_user_login_key}); if ((openid.data || null) == null) { - this.user_login(); + this.user_login(object, method); } else { this.get_user_login_info(object, method, openid.data, auth_data); } diff --git a/public/appmini/old/alipay/app.json b/public/appmini/old/alipay/app.json index 140b2ec29..8bda1bea0 100644 --- a/public/appmini/old/alipay/app.json +++ b/public/appmini/old/alipay/app.json @@ -22,10 +22,12 @@ "pages/answer-form/answer-form", "pages/message/message", "pages/user-integral/user-integral", - "pages/user-goods-browse/user-goods-browse" + "pages/user-goods-browse/user-goods-browse", + "pages/user-orderaftersale/user-orderaftersale", + "pages/user-orderaftersale-detail/user-orderaftersale-detail" ], "window": { - "defaultTitle": "{{application_title}}", + "defaultTitle": "test", "titleBarColor": "#d2364c" }, "tabBar": { diff --git a/public/appmini/old/alipay/pages/cart/cart.js b/public/appmini/old/alipay/pages/cart/cart.js index b4c9106a4..1f8b6971b 100644 --- a/public/appmini/old/alipay/pages/cart/cart.js +++ b/public/appmini/old/alipay/pages/cart/cart.js @@ -27,16 +27,16 @@ Page({ confirmButtonText: '确认', cancelButtonText: '暂不', success: (result) => { + my.stopPullDownRefresh(); if (result.confirm) { my.navigateTo({ url: "/pages/login/login?event_callback=init" }); } else { - my.stopPullDownRefresh(); this.setData({ data_list_loding_status: 0, data_bottom_line_status: false, - data_list_loding_msg: '请先' + msg, + data_list_loding_msg: '请先绑定手机号码', }); } }, diff --git a/public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.acss b/public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.acss new file mode 100644 index 000000000..bf9a2510b --- /dev/null +++ b/public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.acss @@ -0,0 +1,150 @@ +/** + * 商品 + */ +.goods-base { + min-height: 160rpx; + margin-left: 180rpx; +} +.goods .goods-item:not(:last-child) { + border-bottom: 1px dashed #efefef; +} +.goods-item { + padding: 20rpx 10rpx; +} +.goods-title, .goods-attribute { + margin-bottom: 10rpx; +} +.goods-image { + width: 160rpx; + height: 160rpx; + margin-right: 20rpx; +} +.goods-price { + position: relative; +} +.buy-number { + position: absolute; + right: 0; + bottom: 0; +} + +/** + * 类型选择 + */ + .choose-type { + padding: 30rpx 10rpx; + } +.choose-type .choose-item { + width: 44%; + border: 1px solid #eee; + padding: 15rpx; + -webkit-transition: border-color .2s ease-in; + -moz-transition: border-color .2s ease-in; + -ms-transition: border-color .2s ease-in; + -o-transition: border-color .2s ease-in; + transition: border-color .2s ease-in; +} +.choose-type .choose-name { + font-weight: bold; + margin-bottom: 5rpx; +} +.choose-type .choose-item-active { + border: 1px solid #d2364c; + box-shadow: 0px 0 0px 1px #d2364c; +} + +/* + * 售后信息 + */ +.detail { + padding: 20rpx 10rpx; +} +.detail .msg-tips { + padding: 10rpx; + border-radius: 0; + background: #f1faff; + border: 1px solid #e2f5ff; + color: #1490d2; +} +.detail .msg-tips-warning { + background-color: #fff7f1; + border-color: #fff0e4; + color: #f37b1d; +} +.detail .msg-tips-success { + background-color: #eef7ea; + border-color: #e3f3d6; + color: #468847; +} +.detail .msg-tips-danger { + background-color: #fff1f0; + border-color: #ffe4e3; + color: #dd514c; +} +.detail .msg-tips .msg-a { + color: #d2354c; + margin-left: 10rpx; +} +.detail .msg-tips-danger .msg-a { + color: #136ed9; +} + +/* + * 退货地址 + */ +.return-address .address-value { + color: #0e90d2; +} +.detail .msg-tips button { + border-radius: 3px; + height: 60rpx; + line-height: 60rpx; + padding: 0 30rpx; + font-size: 24rpx; + margin-top: 10rpx; +} + +/* + * 面板信息 + */ +.panel-item { + border: 1px solid #eee; +} +.panel-item .panel-title { + background: #eee; + font-weight: bold; + padding: 15rpx; +} +.panel-item .panel-content .item { + padding: 20rpx 0; +} +.panel-item .panel-content .item:last-child { + border: 0; +} +.panel-item .panel-content .item .title { + width: 25%; + padding-left: 20rpx; +} +.panel-item .panel-content .item .content { + width: calc(75% - 50rpx); + padding-left: 20rpx; + min-height: 46rpx; +} +.panel-item .panel-content .item view { + line-height: 46rpx; +} + +/* + * 面板图片 + */ +.panel-item .voucher-data { + padding: 10px 0; +} +.panel-item .voucher-data .item { + padding: 10rpx; +} +.panel-item .voucher-data .item image { + width: 200rpx; + height: 200rpx; + display: block; +} \ No newline at end of file diff --git a/public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.axml b/public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.axml new file mode 100644 index 000000000..7a42a81ae --- /dev/null +++ b/public/appmini/old/alipay/pages/user-orderaftersale-detail/user-orderaftersale-detail.axml @@ -0,0 +1,172 @@ + + + + + + + + {{order_data.items.title}} + + + {{spec.type}}:{{spec.value}} + + + + + ¥{{order_data.items.price}} + ¥{{order_data.items.original_price}} + x{{order_data.items.buy_number}} + + + + + + + + + + {{new_aftersale_data.tips_msg}} + 详情查看 >> + + + + + + + + + 退货地址: + {{return_goods_address}} + + + + + + {{new_aftersale_data.tips_msg}} + 详情查看 >> + + + + + + + 申请信息 + + + {{item.name}} + {{new_aftersale_data[item.field] || ''}} + + + + + + + 快递信息 + + + {{item.name}} + {{new_aftersale_data[item.field] || ''}} + + + + + + + 凭证 + + + + + + + + + + + + + + + + {{item.name}} + {{item.desc}} + + + + + + + + 退款原因必选 + + + {{form_reason_index == -1 ? '请选择原因' : reason_data_list[form_reason_index]}} + + + + + + 商品件数不能大于{{returned_data.returned_quantity}}数量 + + + + + 退款金额不能大于{{returned_data.refund_price}}元 + + + + + 退款说明必填 +