Browse Source

Merge remote-tracking branch 'origin/yijia' into yijia

undefined
娄梦宁 4 years ago
parent
commit
90419a7519
24 changed files with 101 additions and 67 deletions
  1. +10
    -0
      addons/unishop/controller/Order.php
  2. +2
    -2
      addons/unishop/uniapp/uni-shop/pages.json
  3. +1
    -1
      addons/unishop/uniapp/uni-shop/pages/flash/list.vue
  4. +47
    -32
      addons/unishop/uniapp/uni-shop/pages/order/order.vue
  5. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html
  6. +13
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/chunk-vendors.7164a63c.js
  7. +0
    -13
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/chunk-vendors.73b1d7ab.js
  8. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.05b30f5a.js
  9. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.0f07f687.js
  10. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-address.b1b69fb9.js
  11. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-addressManage.2083de58.js
  12. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-addressManage.7b1d509a.js
  13. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-flash-list.88487aed.js
  14. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-flash-list.c98f53e1.js
  15. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.88727e2f.js
  16. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.99f4d294.js
  17. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-money-pay.4310eb47.js
  18. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-money-pay.7b7c2d47.js
  19. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-order.4fa16733.js
  20. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-order.e23b2b52.js
  21. +1
    -1
      application/admin/controller/unishop/Order.php
  22. +3
    -0
      application/admin/controller/user/User.php
  23. +2
    -2
      application/database.php
  24. +14
    -8
      public/assets/js/backend/unishop/order.js

+ 10
- 0
addons/unishop/controller/Order.php View File

@@ -608,6 +608,16 @@ class Order extends Base
if (!$order){
$this->error("订单信息错误");
}
$redis = new Redis();
$flash = $orderModel->alias("o")->
join("unishop_order_product","unishop_order_product.order_id =o.id")
->join("unishop_flash_sale","unishop_order_product.flash_id=unishop_flash_sale.id")
->where(["o.id"=>(int)$order_id,"unishop_flash_sale.status"=>0,"unishop_flash_sale.switch"=>1,"unishop_flash_sale.deletetime"=>0])
->field("flash_id,product_id,endtime")->find();
if (!$flash || $flash->endtime < time()){
$this->error("活动已结束,不支持退款");
}
$sold = $redis->handler->hIncrBy('flash_sale_' . $flash->flash_id. '_' . $flash->product_id, 'sold', -1);
$order->status = \addons\unishop\model\Order::STATUS_REFUND;
$order->refund_status = \addons\unishop\model\Order::REFUND_STATUS_AGREE;
$result = $order->save();


+ 2
- 2
addons/unishop/uniapp/uni-shop/pages.json View File

@@ -6,12 +6,12 @@
"style": {
"enablePullDownRefresh": true,
// #ifdef MP
"navigationBarTitleText": "IKEA SHOP",
"navigationBarTitleText": "IKEA Inside Shop",
//"navigationStyle": "custom",
// #endif
"app-plus": {
"titleNView": {
"titleText": "IKEA SHOP"
"titleText": "IKEA Inside Shop"
//"type": "transparent"
// "searchInput": {
// "backgroundColor": "rgba(231, 231, 231,.7)",


+ 1
- 1
addons/unishop/uniapp/uni-shop/pages/flash/list.vue View File

@@ -4,7 +4,7 @@
<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{current: tabCurrentIndex === index}"
@click="tabClick(index)">
<view class="hour">
<view>{{(new Date(item.starttime)).getFullYear()+'-'+((new Date(item.starttime)).getMonth()+1)+'-'+(new Date(item.starttime)).getDay()}}&nbsp{{item.starttime_hour}}</view>
<view>{{(new Date(item.starttime * 1000)).getFullYear()+'-'+((new Date(item.starttime * 1000)).getMonth()+1)+'-'+(new Date(item.starttime * 1000)).getDate()}}&nbsp{{item.starttime_hour}}</view>
<view class="text">{{state[item.state].text}}</view>
</view>
</view>


+ 47
- 32
addons/unishop/uniapp/uni-shop/pages/order/order.vue View File

@@ -17,12 +17,12 @@
<view v-for="(item,index) in tabItem.orderList" :key="index" class="order-item" @click="navTo('/pages/order/orderDetail?order_id='+item.order_id)">
<view class="i-top b-b">
<text class="time">{{item.createtime}}</text>
<text class="state" :style="{color: item.stateTipColor}">{{item.stateTip + (item.refund_status_text ? ':'+item.refund_status_text : '')}} </text>
<text class="state" :style="{color: item.stateTipColor}">{{item.stateTip + (item.refund_status_text ? ':'+item.refund_status_text : '')}}
</text>
<text v-if="item.state===9" class="del-btn yticon icon-lajitong" @click.stop="deleteOrder(index)"></text>
</view>

<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.products"
:key="goodsIndex">
<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.products" :key="goodsIndex">
<image class="goods-img" :src="goodsItem.image" mode="aspectFill"></image>
<view class="right">
<text class="refund" v-if="goodsItem.refund">退款成功</text>
@@ -52,7 +52,7 @@
<!-- <button class="action-btn" v-if="item.have_received != 0 && item.have_commented != 0">追加评价</button> -->
<!-- <button class="action-btn" v-if="item.have_paid != 0" @click.stop="button('refund', item)">申请售后</button> -->
</view>
<!-- <view class="action-box b-t" v-if="item.state == 9 && item.status == -1">
<!-- <view class="action-box b-t" v-if="item.state == 9 && item.status == -1">
<button class="action-btn" v-if="item.have_paid != 0" @click.stop="button('refund', item)">查看售后</button>
</view> -->
</view>
@@ -74,6 +74,7 @@
data() {
return {
tabCurrentIndex: 0,
// 0=全部,1=待付款,2=待发货,3=待收货,4=待评价,5=售后
navList: [{
state: 0,
text: 'all',
@@ -103,14 +104,14 @@
// page: 1
// },
{
state: 4,
state: 3,
text: 'Completed',
loadingType: 'more',
orderList: [],
page: 1
},
{
state: 5,
state: 4,
text: 'Cancelled',
loadingType: 'more',
orderList: [],
@@ -125,6 +126,7 @@
* 修复app端点击除全部订单外的按钮进入时不加载数据的问题
* 替换onLoad下代码即可
*/
console.log(options)
this.tabCurrentIndex = +options.state;
// #ifndef MP
this.loadData()
@@ -143,6 +145,9 @@
async loadData(source) {
//这里是将订单挂载到tab列表下
let index = this.tabCurrentIndex;
// let navItem = this.navList.find((item) => {
// return item.state == (index == 3 ? '4' : index == 4 ? '9' : index);
// })
let navItem = this.navList[index];
let state = navItem.state;

@@ -162,7 +167,7 @@
navItem.loadingType = 'loading';

let result = await this.$api.request('/order/getOrders', 'GET', {
type: state,
type: state == 3 ? '4' : state == 4 ? '5' : state,
page: navItem.page,
pagesize: this.pageSize
});
@@ -191,6 +196,7 @@

//swiper 切换
changeTab(e) {
console.log(e.target)
this.tabCurrentIndex = e.target.current;
this.loadData('tabChange');
},
@@ -201,25 +207,29 @@
//删除订单
async deleteOrder(index) {
let [error, res] = await uni.showModal({
cancelText:'Cancel',
confirmText:'OK',
cancelText: 'Cancel',
confirmText: 'OK',
title: 'Confirm delete order'
});
if (res.confirm) {
if (res.confirm) {
// let index = this.tabCurrentIndex;
// let order_id = this.navList.find((item) => {
// return item.state == return item.state == (index == 3 ? '4' : index == 4 ? '9' : index);
// }).orderList[index].order_id;
let order_id = this.navList[this.tabCurrentIndex].orderList[index].order_id;
let result = await this.$api.request('/order/delete?order_id=' + order_id)
if (result) {
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
}
}
},
//取消订单
async cancelOrder(item) {
let that = this;
let [error, res] = await uni.showModal({
cancelText:'Cancel',
confirmText:'OK',
cancelText: 'Cancel',
confirmText: 'OK',
title: 'Confirm cancel order',
content: 'Unrecoverable after cancellation',
});
@@ -240,8 +250,9 @@
if (position !== -1) {
that.navList[0].orderList[position] = item;
}
// todo 已取消的添加进已取消列表

//退款后删除待付款中该项
//取消后删除待付款中该项
let list = that.navList[1].orderList;
let index = list.findIndex(val => val.order_id === item.order_id);
index !== -1 && list.splice(index, 1);
@@ -255,8 +266,8 @@
async refunded(item) {
let that = this;
let [error, res] = await uni.showModal({
cancelText:'Cancel',
confirmText:'OK',
cancelText: 'Cancel',
confirmText: 'OK',
title: 'Confirm refund',
content: 'Unrecoverable after refund',
});
@@ -281,7 +292,7 @@
that.navList[0].orderList[position] = item;
}

//取消订单后删除待付款中该项
//退款后删除待发货中该项
let list = that.navList[2].orderList;
let index = list.findIndex(val => val.order_id === item.order_id);
index !== -1 && list.splice(index, 1);
@@ -295,8 +306,8 @@
async receivedOrder(item) {
let that = this;
let [error, res] = await uni.showModal({
cancelText:'Cancel',
confirmText:'OK',
cancelText: 'Cancel',
confirmText: 'OK',
title: 'Confirm receipt'
});
if (res.confirm == true) {
@@ -305,12 +316,12 @@
});
if (res) {
// 已确认收货
let {
stateTip,
stateTipColor
} = that.orderStateExp(4);
// 更新全部订单里面的状态
let position = that.navList[0].orderList.findIndex(val => val.order_id === item.order_id);
if (position !== -1) {
@@ -323,7 +334,7 @@
have_received: 1
});
}
//收货订单后删除待收货中该项
let list = that.navList[3].orderList;
let index = list.findIndex(val => val.order_id === item.order_id);
@@ -348,12 +359,12 @@
case 2:
stateTip = '待发货';
break;
case 3:
stateTip = '待收货';
// case 3: //
// stateTip = '待收货';
// break;
case 4: //
stateTip = '已完成';
break;
// case 4:
// stateTip = '待评价';
// break;
case 5:
stateTip = '已取消';
break;
@@ -399,7 +410,8 @@
this.receivedOrder(item);
break;
case 'evaluate':
this.$api.navTo('/pages/order/evaluate?product_id='+item.id+'&order_id='+item.order_id+'&image='+item.image+'&title='+item.title+'&spec='+item.spec);
this.$api.navTo('/pages/order/evaluate?product_id=' + item.id + '&order_id=' + item.order_id + '&image=' + item.image +
'&title=' + item.title + '&spec=' + item.spec);
break;
case 'refund':
this.$api.navTo('/pages/order/refund?order_id=' + item.order_id);
@@ -440,14 +452,14 @@
// page: 1
// },
{
state: 4,
state: 3,
text: 'Completed',
loadingType: 'more',
orderList: [],
page: 1
},
{
state: 5,
state: 4,
text: 'Cancelled',
loadingType: 'more',
orderList: [],
@@ -598,6 +610,7 @@
padding: 0 30upx 0 24upx;
overflow: hidden;
position: relative;

.title {
font-size: $font-base + 2upx;
color: $font-color-dark;
@@ -620,7 +633,8 @@
margin: 0 2upx 0 8upx;
}
}
.action-btn{

.action-btn {
width: 160rpx;
height: 60rpx;
padding: 0;
@@ -635,7 +649,8 @@
right: 30rpx;
bottom: 0;
}
.refund{

.refund {
position: absolute;
right: 30rpx;
font-size: 28rpx;


+ 1
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html View File

@@ -1,3 +1,3 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>宜家自购商城</title><script>document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.73b1d7ab.js></script><script src=/h5/static/js/index.0f07f687.js></script></body></html>
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.7164a63c.js></script><script src=/h5/static/js/index.05b30f5a.js></script></body></html>

+ 13
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/chunk-vendors.7164a63c.js
File diff suppressed because it is too large
View File


+ 0
- 13
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/chunk-vendors.73b1d7ab.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.05b30f5a.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.0f07f687.js
File diff suppressed because it is too large
View File


addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-address.b1b69fb9.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-addressManage.2083de58.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-addressManage.7b1d509a.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-flash-list.88487aed.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-flash-list.c98f53e1.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.88727e2f.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.99f4d294.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-money-pay.4310eb47.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-money-pay.7b7c2d47.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-order.4fa16733.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-order.e23b2b52.js
File diff suppressed because it is too large
View File


+ 1
- 1
application/admin/controller/unishop/Order.php View File

@@ -26,7 +26,7 @@ class Order extends Backend
*/
protected $relationSearch = true;

protected $noNeedLogin=["export","finish"];
protected $noNeedLogin=["export","finish","doRefund"];

/**
* Order模型对象


+ 3
- 0
application/admin/controller/user/User.php View File

@@ -109,6 +109,9 @@ class User extends Backend
//修改的是密码
$val= \app\common\library\Auth::instance()->getEncryptPassword($val, $salt);
}
if ($currentColumn==5 && !$val){
$val=-1;
}
if (!$val){
continue 2;
}


+ 2
- 2
application/database.php View File

@@ -20,9 +20,9 @@ return [
// 数据库名
'database' => Env::get('database.database', 'shop'),
// 用户名
'username' => Env::get('database.username', 'root'),
'username' => Env::get('database.username', 'shopweb'),
// 密码
'password' => Env::get('database.password', 'zBg%V91jGrJPbvf5'),
'password' => Env::get('database.password', 'skOId!sl23huI'),
// 端口
'hostport' => Env::get('database.hostport', ''),
// 连接dsn


+ 14
- 8
public/assets/js/backend/unishop/order.js View File

@@ -167,14 +167,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
window.location.href="order/export"
});
$(document).on("click", ".btn-finish", function () {
// window.location.href="order/finish"
Fast.api.ajax({
url:"unishop/order/finish",
loading:false
}, function(data, ret){
//成功回调
// layer.msg('操作成功!');
});
Layer.confirm(
__('确定要完成所有订单?'),
{icon: 3, title: __('Warning'), offset: 0, shadeClose: true},
function (index) {
Fast.api.ajax({
url:"unishop/order/finish",
loading:false
}, function(data, ret){
//成功回调
Layer.close(index);
// layer.msg('操作成功!');
});
}
);
});
},
recyclebin: function () {


Loading…
Cancel
Save