Browse Source

调整

undefined
xubinxcode 4 years ago
parent
commit
e058789944
22 changed files with 86 additions and 65 deletions
  1. +5
    -1
      addons/unishop/uniapp/uni-shop/App.vue
  2. +6
    -6
      addons/unishop/uniapp/uni-shop/pages.json
  3. +43
    -32
      addons/unishop/uniapp/uni-shop/pages/cart/cart.vue
  4. +10
    -4
      addons/unishop/uniapp/uni-shop/pages/product/product.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.445a3e90.js
  7. +0
    -13
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/chunk-vendors.e7876d6b.js
  8. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.8bf16446.js
  9. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.cd755b03.js
  10. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-address.32241c21.js
  11. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-address.91db4581.js
  12. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-addressManage.5c8d3919.js
  13. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-address-addressManage.7044ecfb.js
  14. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-cart-cart.af8c04bc.js
  15. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-cart-cart.de452e15.js
  16. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.c2f8659c.js
  17. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-money-pay.884c38b5.js
  18. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-money-pay.e577ef7b.js
  19. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-order.10f1590e.js
  20. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-order.4545fc9d.js
  21. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.a9523c71.js
  22. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.f961f385.js

+ 5
- 1
addons/unishop/uniapp/uni-shop/App.vue View File

@@ -54,7 +54,11 @@
max-width: 750px;
margin: 0 auto;
}

uni-modal {
.uni-modal__hd {
padding: 20px !important;
}
}
/* project id 1729059 */
@font-face {
font-family: 'unishop';


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

@@ -264,12 +264,12 @@
"selectedIconPath": "static/tab-home-current.png",
"text": "Home"
},
// {
// "pagePath": "pages/category/category",
// "iconPath": "static/tab-cate.png",
// "selectedIconPath": "static/tab-cate-current.png",
// "text": "Catagory"
// },
{
"pagePath": "pages/category/category",
"iconPath": "static/tab-cate.png",
"selectedIconPath": "static/tab-cate-current.png",
"text": "Catagory"
},
{
"pagePath": "pages/cart/cart",
"iconPath": "static/tab-cart.png",


+ 43
- 32
addons/unishop/uniapp/uni-shop/pages/cart/cart.vue View File

@@ -16,12 +16,12 @@
<!-- 列表 -->
<view class="cart-list">
<block v-for="(item, index) in cartList" :key="item.id">
<view class="cart-item" :class="{'b-b': index!==cartList.length-1}" :style="{'background':item.isset?'':'#f5f5f5'}"
@click="navTo(`/pages/product/product?id=${item.product_id}&flash=0`)"
>
<view class="cart-item" :class="{'b-b': index!==cartList.length-1}" :style="{'background':item.isset?'':'#f5f5f5'}"
@click="navTo(`/pages/product/product?id=${item.product_id}&flash=0`)">
<view class="image-wrapper">
<image :src="item.image" class="loaded" mode="aspectFill"></image>
<view v-if="item.isset == true" class="yticon icon-xuanzhong checkbox" :class="{checked: item.choose}" @click.stop="check('item', index)"></view>
<view v-if="item.isset == true" class="yticon icon-xuanzhong checkbox" :class="{checked: item.choose}"
@click.stop="check('item', index)"></view>
</view>
<view class="item-right">
<text class="clamp title">{{item.title}}</text>
@@ -39,7 +39,8 @@
<!-- 底部菜单栏 -->
<view class="action-section" v-if="state != 'load'">
<view class="checkbox">
<image :src="allChoose?'/static/selected.png':'/static/select.png'" mode="aspectFit" @click="check('all')"></image>
<image style="position: absolute;" :src="allChoose?'/static/selected.png':'/static/select.png'" mode="aspectFit"
@click="check('all')"></image>
<view class="clear-btn" :class="{show: allChoose}" @click="clearCart">
清空
</view>
@@ -68,11 +69,11 @@
allChoose: false, //全选状态 true|false
empty: false, //空白页现实 true|false
cartList: [],
state : 'load'
state: 'load'
};
},
onLoad() {
},
onPullDownRefresh() {
this.state = 'load';
@@ -103,11 +104,11 @@
let data = await this.$api.request('/cart');
uni.stopPullDownRefresh();
this.state = 'loaded';
if (data){
if (data) {
this.cartList = data;
this.calcTotal();
}
}
},
cartPrice(oldPrice, nowPrice) {
@@ -128,18 +129,18 @@
},
//选中状态处理
async check(type, index) {
let trueArr = [];
let falseArr = [];
let oldChoose = [];
const list = this.cartList;
//保存旧的数据
list.forEach(item => {
if(item.choose){
if (item.choose) {
oldChoose.push(item.cart_id);
}
})
//本地处理
if (type === 'item') {
this.cartList[index].choose = !this.cartList[index].choose;
@@ -163,9 +164,12 @@
this.allChoose = choose;
}
this.calcTotal(type);
//远程处理
let result = await this.$api.request('/cart/choose_change', 'POST', {trueArr,falseArr});
let result = await this.$api.request('/cart/choose_change', 'POST', {
trueArr,
falseArr
});
if (!result) {
//恢复原来勾选的状态
list.forEach(item => {
@@ -177,7 +181,7 @@
})
this.calcTotal(type);
}
},
//数量
async numberChange(data) {
@@ -185,28 +189,32 @@
let newNumber = data.number;
this.cartList[data.index].number = newNumber;
this.calcTotal();
let cart_id = this.cartList[data.index].cart_id;
let result = await this.$api.request('/cart/number_change?id='+cart_id, 'GET', {number:newNumber}, false);
let result = await this.$api.request('/cart/number_change?id=' + cart_id, 'GET', {
number: newNumber
}, false);
if (!result) {
this.cartList[data.index].number = oldNumber;
this.calcTotal();
}
},
//删除
async deleteCartItem(index) {
let list = this.cartList;
let row = list[index];
let id = row.cart_id;
uni.showModal({
cancelText:'Cancel',
confirmText:'OK',
content: 'Confirm delete ' + list[index].title + '?' ,
cancelText: 'Cancel',
confirmText: 'OK',
content: 'Confirm delete ' + list[index].title + '?',
success: async (e) => {
if (e.confirm) {
let result = await this.$api.request('/cart/delete?', 'POST', {id:id});
let result = await this.$api.request('/cart/delete?', 'POST', {
id: id
});
if (result) {
let tempCart = this.cartList.splice(index, 1);
this.calcTotal();
@@ -223,17 +231,19 @@
});
if (res.confirm) {
let id = [];
this.cartList.forEach(item=>{
this.cartList.forEach(item => {
id.push(item.cart_id);
});
let data = this.$api.request('/cart/delete', 'POST',{id:id});
let data = this.$api.request('/cart/delete', 'POST', {
id: id
});
let that = this;
if (data) {
setTimeout(function(){
setTimeout(function() {
that.state = 'load';
that.cartList = [];
that.getCart();
},300);
}, 300);
}
}
},
@@ -273,7 +283,7 @@
}
this.$api.navTo(`/pages/order/createOrder?cart=${cartId.join(',')}`);
},
navTo(url){
navTo(url) {
this.$api.navTo(url);
}
}
@@ -281,9 +291,10 @@
</script>

<style lang='scss'>

.container {
padding-bottom: 134upx;
/* 空白页 */
.empty {
position: fixed;
@@ -402,13 +413,13 @@
/* #ifdef H5 */
margin-bottom: 100upx;
/* #endif */
position: fixed;
position: absolute;
left: 30upx;
bottom: 30upx;
right: 30upx;
bottom: -80upx;
z-index: 95;
display: flex;
align-items: center;
width: 690upx;
height: 100upx;
padding: 0 30upx;
background: rgba(255, 255, 255, .9);


+ 10
- 4
addons/unishop/uniapp/uni-shop/pages/product/product.vue View File

@@ -139,12 +139,16 @@
<view class="action-btn-group" v-if="countdown && progress.number != progress.sold">
<button v-if="product.flash.text=='距开始:'" :class="{'only': flash}" type="primary" disabled class=" action-btn-gray action-btn no-border buy-now-btn">Buy&nbspNow</button>
<button v-else :class="{'only': flash}" type="primary" class=" action-btn no-border buy-now-btn" @click="buy">Buy&nbspNow</button>
<!-- <button v-if="!flash" type="primary" class=" action-btn no-border add-cart-btn" @click="addCart">加入购物车</button> -->
<button v-if="!flash" type="primary" class=" action-btn no-border add-cart-btn" @click="addCart">加入购物车</button>
</view>
<view class="p-b-btn" v-else>
<!-- 站位 -->
<text></text>
<view class="action-btn-group" v-else>
<button v-if="!flash" type="primary" class=" action-btn no-border add-cart-btn" @click="addCart">加入购物车</button>
<button :class="{'only': flash}" type="primary" class=" action-btn no-border buy-now-btn" @click="buy">立即购买</button>
</view>
<!-- <view class="p-b-btn" v-else> -->
<!-- 站位
<text></text>
<!-- </view> -->
</view>

<!-- 领取优惠券-模态层弹窗 -->
@@ -482,7 +486,9 @@
padding-bottom: 160upx;
}
.rich-text-a{
/* #ifdef H5 */
font-size: 19px;
/* #endif */
}
.icon-you {
font-size: $font-base + 2upx;


+ 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.e7876d6b.js></script><script src=/h5/static/js/index.8bf16446.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.445a3e90.js></script><script src=/h5/static/js/index.cd755b03.js></script></body></html>

+ 13
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/chunk-vendors.445a3e90.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.e7876d6b.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.8bf16446.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.cd755b03.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-address.32241c21.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-address.91db4581.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.5c8d3919.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.7044ecfb.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-cart-cart.af8c04bc.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-cart-cart.de452e15.js
File diff suppressed because it is too large
View File


addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.c2f8659c.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.884c38b5.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.e577ef7b.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.10f1590e.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.4545fc9d.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-product-product.a9523c71.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-product-product.f961f385.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save