diff --git a/.history/pages/product-detail/product-detail_20201130173122.wxml b/.history/pages/product-detail/product-detail_20201130173122.wxml new file mode 100644 index 0000000..ca62b90 --- /dev/null +++ b/.history/pages/product-detail/product-detail_20201130173122.wxml @@ -0,0 +1,204 @@ +<!--pages/product-detail/product-detail.wxml--> +<!-- 商品详情 --> +<view class="container"> + <view class="productIntro"> + <view class="pic"> + <view style="height:750rpx"> + <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> + <block wx:for="{{swiperArray}}" wx:for-index="idx"> + <swiper-item> + <image src="{{item}}" class="slideImage"></image> + </swiper-item> + </block> + </swiper> + </view> + <view class="countDown" wx:if="{{goodsData.youHui}}"> + <text class="countDownTxt">距结束仅剩</text> + <!-- 倒计时 --> + <view class="countTime"> + <van-count-down use-slot time="{{ time }}" bind:change="onChange1"> + <text class="item">{{ timeData.hours }}</text>: + <text style="color:#FF593C">:</text> + <text class="item">{{ timeData.minutes }}</text>: + <text style="color:#FF593C">:</text> + <text class="item">{{ timeData.seconds }}</text> + </van-count-down> + </view> + </view> + </view> + <view class="productName"> + {{goodsData.goodsName}} + </view> + <view class="productPrice"> + <view class="price" wx:if="{{goodsData.type==2}}">¥{{goodsData.goodsPrice}}</view> + <view class="jifen" wx:if="{{goodsData.type==1}}">积分{{goodsData.goodsPrice}}</view> + <view class="share" data-id="{{goodsId}}"> + <view class="shareIcon"> + <image src="/images/01-03/icon_share@2x.png"></image> + </view> + <view class="shareTitle">分享</view> + <button open-type="share" data-id="{{goodsId}}"></button> + </view> + </view> + + </view> + <!-- 请选择 --> + <view class="selectMain" bindtap="selectSku"> + <view class="selectTitle">选择</view> + <view class="selectNum"> + <view>{{}}</view> + <view class="selectPic"> + <image src="/images/01-03/icon_more@2x.png"></image> + </view> + </view> + </view> + <!-- 评价 --> + <view class='{{flags?"evaluateContent":"evaluateContents"}}'> + <view class="evaluateTop"> + <view class="evaluateTitle">宝贝评价({{pingjiaNum}})</view> + <view class="lookMain" data-type="{{flag}}"> + <view wx:if="{{flag==1}}" bindtap="openAll">查看全部</view> + <view wx:if="{{flag==0}}" bindtap="openAll">收起全部</view> + <view> + <image src="/images/01-03/icon_more@2x.png"></image> + </view> + </view> + </view> + <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view> + <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> + <view class="evaluateInfo"> + <view class="userImg" style="display:inline-block"> + <image src="{{item.wxHeadImg}}"> </image> + </view> + <view class="userName" style="display:inline-block">{{item.wxName}}</view> + </view> + <view class="evaluateDetails">{{item.content}}</view> + <view class="evaluatePic"> + <view class="picBox" wx:for="{{item.images}}"> + <image src="item"></image> + </view> + </view> + </view> + </view> + <!-- 商品明细--> + <view class="prodectDesc"> + <rich-text nodes="{{richText}}"></rich-text> + <!-- <view wx:for="{{deacArray}}" class="descBox"> + <image src="{{item.img}}"></image> + </view> --> + </view> +</view> +<!--底部 --> +<!-- <view class="bottomMain"> + <van-goods-action> + <van-goods-action-icon icon="chat-o" text="客服" color="#07c160" /> + <van-goods-action-icon icon="cart-o" text="购物车" /> + <van-goods-action-icon icon="star" text="已收藏" color="#ff5000" /> + <van-goods-action-button type="warning" text="加入购物车" /> + <van-goods-action-button type="danger" text="立即购买" /> + </van-goods-action> +</view> --> +<view class="bottom"> + <view class="bottom_left"> + <view class="bottom_left_item" catchtap="linkKefu"> + <image src="/images/01-03/kefu.png"></image> + <view>客服</view> + </view> + <view class="bottom_left_item" catchtap="goCart"> + <view class="count_cart">{{count}}</view> + <image src="/images/01-03/cart.png"></image> + <view>购物车</view> + </view> + <view class="bottom_left_item" catchtap="collection"> + <view class="collectIcon"> + <image src='{{"goodsData.keep==false"?"/images/01-03/shoucang.png":"/images/01-03/shoucang.png"}}'></image> + <view class="collecttext">{{goodsData.keep==false?"收藏":"已收藏"}}</view> + </view> + <!-- <view wx:if="{{goodsData.keep==true}}"> + <image src="/images/01-03/shoucang.png"></image> + <view>已收藏</view> + </view> --> + </view> + </view> + <view class="bottom_right" wx:if="{{goodsData.type==2}}"> + <view class="bottom_right_left" catchtap="addCart">加入购物车</view> + <view class="bottom_right_right" catchtap="immediatelyPay">立即购买</view> + <view class="Mask"></view> + </view> + <view class="bottom_right_two" wx:if="{{goodsData.type==1}}"> + <view class="bottom_right_right_two" catchtap="immediatelyPay">立即兑换</view> + </view> +</view> +<!-- 选择规格弹框 --> +<view class="mask" catchtap="closeMaskSku" wx:if='{{showMaskSku}}'> + <view class="diceng"> + <view class="skuBox"> + <view wx:for="{{goodsData.list}}" class="{{idx==index?'skuItem1':'skuItem'}}" bindtap="check" + data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view> + </view> + </view> +</view> +<!-- 加入购物车弹框 --> +<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> + <view class="diceng" catchtap="openMask"> + <view class="info"> + <image src="{{goodsData.goodsBanners[idx]}}"></image> + <view class="info_right"> + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> + </view> + </view> + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> + <view>{{item.group_name}}</view> + <view class="attr_main"> + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' + catchtap="changeAttrNum">{{cell.spec_value}}</view> + </view> + </view> + <view class="pay_count"> + <view>购买数量</view> + <view class="count_box"> + <view class="count_jian" catchtap="decNum">-</view> + <view class="real_count">{{count}}</view> + <view class="count_jian" catchtap="addNum">+</view> + </view> + </view> + <view class="confrimBtn" catchtap="confrimCart">确定</view> + <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> + <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> + </view> +</view> +<!-- 立即购买弹框 --> +<view class="mask" catchtap="closeMaskTwo" wx:if='{{showMaskTwo}}'> + <view class="diceng" catchtap="openMask"> + <view class="info"> + <image src="{{goodsData.goodsBanners[0]}}"></image> + <view class="info_right"> + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> + </view> + </view> + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> + <view>{{item.group_name}}</view> + <view class="attr_main"> + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' + catchtap="changeAttrNum">{{cell.spec_value}}</view> + </view> + </view> + <view class="pay_count"> + <view>购买数量</view> + <view class="count_box"> + <view class="count_jian" catchtap="dec">-</view> + <view class="real_count">{{payCount}}</view> + <view class="count_jian" catchtap="add">+</view> + </view> + </view> + <view class="confrimBtn" catchtap="confrim">确定</view> + <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> + <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> + </view> +</view> \ No newline at end of file diff --git a/.history/pages/product-detail/product-detail_20201130173538.wxml b/.history/pages/product-detail/product-detail_20201130173538.wxml new file mode 100644 index 0000000..16a67d1 --- /dev/null +++ b/.history/pages/product-detail/product-detail_20201130173538.wxml @@ -0,0 +1,204 @@ +<!--pages/product-detail/product-detail.wxml--> +<!-- 商品详情 --> +<view class="container"> + <view class="productIntro"> + <view class="pic"> + <view style="height:750rpx"> + <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> + <block wx:for="{{swiperArray}}" wx:for-index="idx"> + <swiper-item> + <image src="{{item}}" class="slideImage"></image> + </swiper-item> + </block> + </swiper> + </view> + <view class="countDown" wx:if="{{goodsData.youHui}}"> + <text class="countDownTxt">距结束仅剩</text> + <!-- 倒计时 --> + <view class="countTime"> + <van-count-down use-slot time="{{ time }}" bind:change="onChange1"> + <text class="item">{{ timeData.hours }}</text>: + <text style="color:#FF593C">:</text> + <text class="item">{{ timeData.minutes }}</text>: + <text style="color:#FF593C">:</text> + <text class="item">{{ timeData.seconds }}</text> + </van-count-down> + </view> + </view> + </view> + <view class="productName"> + {{goodsData.goodsName}} + </view> + <view class="productPrice"> + <view class="price" wx:if="{{goodsData.type==2}}">¥{{goodsData.goodsPrice}}</view> + <view class="jifen" wx:if="{{goodsData.type==1}}">积分{{goodsData.goodsPrice}}</view> + <view class="share" data-id="{{goodsId}}"> + <view class="shareIcon"> + <image src="/images/01-03/icon_share@2x.png"></image> + </view> + <view class="shareTitle">分享</view> + <button open-type="share" data-id="{{goodsId}}"></button> + </view> + </view> + + </view> + <!-- 请选择 --> + <view class="selectMain" bindtap="selectSku"> + <view class="selectTitle">选择</view> + <view class="selectNum"> + <view>{{}}</view> + <view class="selectPic"> + <image src="/images/01-03/icon_more@2x.png"></image> + </view> + </view> + </view> + <!-- 评价 --> + <view class='{{flags?"evaluateContent":"evaluateContents"}}'> + <view class="evaluateTop"> + <view class="evaluateTitle">宝贝评价({{pingjiaNum}})</view> + <view class="lookMain" data-type="{{flag}}"> + <view wx:if="{{flag==1}}" bindtap="openAll">查看全部</view> + <view wx:if="{{flag==0}}" bindtap="openAll">收起全部</view> + <view> + <image src="/images/01-03/icon_more@2x.png"></image> + </view> + </view> + </view> + <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view> + <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> + <view class="evaluateInfo"> + <view class="userImg" style="display:inline-block"> + <image src="{{item.wxHeadImg}}"> </image>images[0] + </view> + <view class="userName" style="display:inline-block">{{item.wxName}}</view> + </view> + <view class="evaluateDetails">{{item.content}}</view> + <view class="evaluatePic"> + <view class="picBox" wx:for="{{item.images}}"> + <image src="item"></image> + </view> + </view> + </view> + </view> + <!-- 商品明细--> + <view class="prodectDesc"> + <rich-text nodes="{{richText}}"></rich-text> + <!-- <view wx:for="{{deacArray}}" class="descBox"> + <image src="{{item.img}}"></image> + </view> --> + </view> +</view> +<!--底部 --> +<!-- <view class="bottomMain"> + <van-goods-action> + <van-goods-action-icon icon="chat-o" text="客服" color="#07c160" /> + <van-goods-action-icon icon="cart-o" text="购物车" /> + <van-goods-action-icon icon="star" text="已收藏" color="#ff5000" /> + <van-goods-action-button type="warning" text="加入购物车" /> + <van-goods-action-button type="danger" text="立即购买" /> + </van-goods-action> +</view> --> +<view class="bottom"> + <view class="bottom_left"> + <view class="bottom_left_item" catchtap="linkKefu"> + <image src="/images/01-03/kefu.png"></image> + <view>客服</view> + </view> + <view class="bottom_left_item" catchtap="goCart"> + <view class="count_cart">{{count}}</view> + <image src="/images/01-03/cart.png"></image> + <view>购物车</view> + </view> + <view class="bottom_left_item" catchtap="collection"> + <view class="collectIcon"> + <image src='{{"goodsData.keep==false"?"/images/01-03/shoucang.png":"/images/01-03/shoucang.png"}}'></image> + <view class="collecttext">{{goodsData.keep==false?"收藏":"已收藏"}}</view> + </view> + <!-- <view wx:if="{{goodsData.keep==true}}"> + <image src="/images/01-03/shoucang.png"></image> + <view>已收藏</view> + </view> --> + </view> + </view> + <view class="bottom_right" wx:if="{{goodsData.type==2}}"> + <view class="bottom_right_left" catchtap="addCart">加入购物车</view> + <view class="bottom_right_right" catchtap="immediatelyPay">立即购买</view> + <view class="Mask"></view> + </view> + <view class="bottom_right_two" wx:if="{{goodsData.type==1}}"> + <view class="bottom_right_right_two" catchtap="immediatelyPay">立即兑换</view> + </view> +</view> +<!-- 选择规格弹框 --> +<view class="mask" catchtap="closeMaskSku" wx:if='{{showMaskSku}}'> + <view class="diceng"> + <view class="skuBox"> + <view wx:for="{{goodsData.list}}" class="{{idx==index?'skuItem1':'skuItem'}}" bindtap="check" + data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view> + </view> + </view> +</view> +<!-- 加入购物车弹框 --> +<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> + <view class="diceng" catchtap="openMask"> + <view class="info"> + <image src="{{goodsData.goodsBanners[idx]}}"></image> + <view class="info_right"> + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> + </view> + </view> + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> + <view>{{item.group_name}}</view> + <view class="attr_main"> + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' + catchtap="changeAttrNum">{{cell.spec_value}}</view> + </view> + </view> + <view class="pay_count"> + <view>购买数量</view> + <view class="count_box"> + <view class="count_jian" catchtap="decNum">-</view> + <view class="real_count">{{count}}</view> + <view class="count_jian" catchtap="addNum">+</view> + </view> + </view> + <view class="confrimBtn" catchtap="confrimCart">确定</view> + <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> + <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> + </view> +</view> +<!-- 立即购买弹框 --> +<view class="mask" catchtap="closeMaskTwo" wx:if='{{showMaskTwo}}'> + <view class="diceng" catchtap="openMask"> + <view class="info"> + <image src="{{goodsData.goodsBanners[0]}}"></image> + <view class="info_right"> + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> + </view> + </view> + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> + <view>{{item.group_name}}</view> + <view class="attr_main"> + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' + catchtap="changeAttrNum">{{cell.spec_value}}</view> + </view> + </view> + <view class="pay_count"> + <view>购买数量</view> + <view class="count_box"> + <view class="count_jian" catchtap="dec">-</view> + <view class="real_count">{{payCount}}</view> + <view class="count_jian" catchtap="add">+</view> + </view> + </view> + <view class="confrimBtn" catchtap="confrim">确定</view> + <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> + <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> + </view> +</view> \ No newline at end of file diff --git a/.history/pages/product-detail/product-detail_20201130173542.wxml b/.history/pages/product-detail/product-detail_20201130173542.wxml new file mode 100644 index 0000000..ca62b90 --- /dev/null +++ b/.history/pages/product-detail/product-detail_20201130173542.wxml @@ -0,0 +1,204 @@ +<!--pages/product-detail/product-detail.wxml--> +<!-- 商品详情 --> +<view class="container"> + <view class="productIntro"> + <view class="pic"> + <view style="height:750rpx"> + <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> + <block wx:for="{{swiperArray}}" wx:for-index="idx"> + <swiper-item> + <image src="{{item}}" class="slideImage"></image> + </swiper-item> + </block> + </swiper> + </view> + <view class="countDown" wx:if="{{goodsData.youHui}}"> + <text class="countDownTxt">距结束仅剩</text> + <!-- 倒计时 --> + <view class="countTime"> + <van-count-down use-slot time="{{ time }}" bind:change="onChange1"> + <text class="item">{{ timeData.hours }}</text>: + <text style="color:#FF593C">:</text> + <text class="item">{{ timeData.minutes }}</text>: + <text style="color:#FF593C">:</text> + <text class="item">{{ timeData.seconds }}</text> + </van-count-down> + </view> + </view> + </view> + <view class="productName"> + {{goodsData.goodsName}} + </view> + <view class="productPrice"> + <view class="price" wx:if="{{goodsData.type==2}}">¥{{goodsData.goodsPrice}}</view> + <view class="jifen" wx:if="{{goodsData.type==1}}">积分{{goodsData.goodsPrice}}</view> + <view class="share" data-id="{{goodsId}}"> + <view class="shareIcon"> + <image src="/images/01-03/icon_share@2x.png"></image> + </view> + <view class="shareTitle">分享</view> + <button open-type="share" data-id="{{goodsId}}"></button> + </view> + </view> + + </view> + <!-- 请选择 --> + <view class="selectMain" bindtap="selectSku"> + <view class="selectTitle">选择</view> + <view class="selectNum"> + <view>{{}}</view> + <view class="selectPic"> + <image src="/images/01-03/icon_more@2x.png"></image> + </view> + </view> + </view> + <!-- 评价 --> + <view class='{{flags?"evaluateContent":"evaluateContents"}}'> + <view class="evaluateTop"> + <view class="evaluateTitle">宝贝评价({{pingjiaNum}})</view> + <view class="lookMain" data-type="{{flag}}"> + <view wx:if="{{flag==1}}" bindtap="openAll">查看全部</view> + <view wx:if="{{flag==0}}" bindtap="openAll">收起全部</view> + <view> + <image src="/images/01-03/icon_more@2x.png"></image> + </view> + </view> + </view> + <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view> + <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> + <view class="evaluateInfo"> + <view class="userImg" style="display:inline-block"> + <image src="{{item.wxHeadImg}}"> </image> + </view> + <view class="userName" style="display:inline-block">{{item.wxName}}</view> + </view> + <view class="evaluateDetails">{{item.content}}</view> + <view class="evaluatePic"> + <view class="picBox" wx:for="{{item.images}}"> + <image src="item"></image> + </view> + </view> + </view> + </view> + <!-- 商品明细--> + <view class="prodectDesc"> + <rich-text nodes="{{richText}}"></rich-text> + <!-- <view wx:for="{{deacArray}}" class="descBox"> + <image src="{{item.img}}"></image> + </view> --> + </view> +</view> +<!--底部 --> +<!-- <view class="bottomMain"> + <van-goods-action> + <van-goods-action-icon icon="chat-o" text="客服" color="#07c160" /> + <van-goods-action-icon icon="cart-o" text="购物车" /> + <van-goods-action-icon icon="star" text="已收藏" color="#ff5000" /> + <van-goods-action-button type="warning" text="加入购物车" /> + <van-goods-action-button type="danger" text="立即购买" /> + </van-goods-action> +</view> --> +<view class="bottom"> + <view class="bottom_left"> + <view class="bottom_left_item" catchtap="linkKefu"> + <image src="/images/01-03/kefu.png"></image> + <view>客服</view> + </view> + <view class="bottom_left_item" catchtap="goCart"> + <view class="count_cart">{{count}}</view> + <image src="/images/01-03/cart.png"></image> + <view>购物车</view> + </view> + <view class="bottom_left_item" catchtap="collection"> + <view class="collectIcon"> + <image src='{{"goodsData.keep==false"?"/images/01-03/shoucang.png":"/images/01-03/shoucang.png"}}'></image> + <view class="collecttext">{{goodsData.keep==false?"收藏":"已收藏"}}</view> + </view> + <!-- <view wx:if="{{goodsData.keep==true}}"> + <image src="/images/01-03/shoucang.png"></image> + <view>已收藏</view> + </view> --> + </view> + </view> + <view class="bottom_right" wx:if="{{goodsData.type==2}}"> + <view class="bottom_right_left" catchtap="addCart">加入购物车</view> + <view class="bottom_right_right" catchtap="immediatelyPay">立即购买</view> + <view class="Mask"></view> + </view> + <view class="bottom_right_two" wx:if="{{goodsData.type==1}}"> + <view class="bottom_right_right_two" catchtap="immediatelyPay">立即兑换</view> + </view> +</view> +<!-- 选择规格弹框 --> +<view class="mask" catchtap="closeMaskSku" wx:if='{{showMaskSku}}'> + <view class="diceng"> + <view class="skuBox"> + <view wx:for="{{goodsData.list}}" class="{{idx==index?'skuItem1':'skuItem'}}" bindtap="check" + data-index="{{index}}" data-id="{{item.goodsSkuId}}">{{item.goodsSkuName}}</view> + </view> + </view> +</view> +<!-- 加入购物车弹框 --> +<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> + <view class="diceng" catchtap="openMask"> + <view class="info"> + <image src="{{goodsData.goodsBanners[idx]}}"></image> + <view class="info_right"> + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> + </view> + </view> + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> + <view>{{item.group_name}}</view> + <view class="attr_main"> + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' + catchtap="changeAttrNum">{{cell.spec_value}}</view> + </view> + </view> + <view class="pay_count"> + <view>购买数量</view> + <view class="count_box"> + <view class="count_jian" catchtap="decNum">-</view> + <view class="real_count">{{count}}</view> + <view class="count_jian" catchtap="addNum">+</view> + </view> + </view> + <view class="confrimBtn" catchtap="confrimCart">确定</view> + <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> + <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> + </view> +</view> +<!-- 立即购买弹框 --> +<view class="mask" catchtap="closeMaskTwo" wx:if='{{showMaskTwo}}'> + <view class="diceng" catchtap="openMask"> + <view class="info"> + <image src="{{goodsData.goodsBanners[0]}}"></image> + <view class="info_right"> + <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> + <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> + <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> + </view> + </view> + <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> + <view>{{item.group_name}}</view> + <view class="attr_main"> + <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' + wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' + catchtap="changeAttrNum">{{cell.spec_value}}</view> + </view> + </view> + <view class="pay_count"> + <view>购买数量</view> + <view class="count_box"> + <view class="count_jian" catchtap="dec">-</view> + <view class="real_count">{{payCount}}</view> + <view class="count_jian" catchtap="add">+</view> + </view> + </view> + <view class="confrimBtn" catchtap="confrim">确定</view> + <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> + <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> + </view> +</view> \ No newline at end of file diff --git a/images/classify.png b/images/classify.png new file mode 100644 index 0000000..0c654b6 Binary files /dev/null and b/images/classify.png differ diff --git a/pages/add-address/add-address.js b/pages/add-address/add-address.js index 2c6453f..46b7740 100644 --- a/pages/add-address/add-address.js +++ b/pages/add-address/add-address.js @@ -85,6 +85,7 @@ Page({ wx.getLocation({ type: 'gcj02', success(res) { + console.log(res, 'rs') const location = JSON.stringify({ latitude: res.latitude, longitude: res.longitude @@ -140,8 +141,6 @@ Page({ }) } else { let delFlags = this.data.checked == true ? 1 : 0; - // let region = this.data.region; - // let addressStr = region[0] + "" + region[1] + "" + region[2] let postData = { address: this.data.value, area: this.data.location, @@ -159,20 +158,23 @@ Page({ title: '保存成功', icon: 'none' }) - wx.redirectTo({ - url: '/pages/select-address/select-address?edit=1', + // wx.redirectTo({ + // url: '/pages/select-address/select-address?edit=1', + // }) + wx.navigateBack({ + delta: 1, }) } else { wx.showToast({ title: '地址超出配送费范围请重新选择', - icon:'none' + icon: 'none' }) } }) } }, onLoad: function (options) { - + this.map(); }, /** diff --git a/pages/apply-after-sale/apply-after-sale.wxml b/pages/apply-after-sale/apply-after-sale.wxml index c2d1d0a..1380128 100644 --- a/pages/apply-after-sale/apply-after-sale.wxml +++ b/pages/apply-after-sale/apply-after-sale.wxml @@ -49,7 +49,7 @@ <view> 退款原因</view> </view> <view class="reason"> - <view>{{text.text}}</view> + <view>{{text}}</view> <view style="margin-left:16rpx"> <image src="/images/04-01/arrow.png"></image> </view> diff --git a/pages/classify/classify.js b/pages/classify/classify.js index 54889ab..624b183 100644 --- a/pages/classify/classify.js +++ b/pages/classify/classify.js @@ -22,8 +22,59 @@ Page({ longitude: '', //经度 }, //获取定位 + getSetting(){ + wx.getSetting({ + success: (res) => { + console.log(JSON.stringify(res)) + if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + success: function (res) { + if (res.cancel) { + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000 + }) + } else if (res.confirm) { + wx.openSetting({ + success: function (dataAu) { + if (dataAu.authSetting["scope.userLocation"] == true) { + wx.showToast({ + title: '授权成功', + icon: 'success', + duration: 1000 + }) + //再次授权,调用wx.getLocation的API + this.getLocations() + + } else { + wx.showToast({ + title: '授权失败', + icon: 'none', + duration: 1000 + }) + } + } + }) + } + } + }) + } else if (res.authSetting['scope.userLocation'] == undefined) { + //调用wx.getLocation的API + this.getLocations() + + } else { + //调用wx.getLocation的API + this.getLocations() + } + } + }) +}, getLocations() { - let that = this + let that = this; + console.log("getLocations") wx.getLocation({ type: 'gcj02', success(res) { @@ -34,8 +85,6 @@ Page({ that.location(); const speed = res.speed const accuracy = res.accuracy - console.log(that.data.latitude, '维度') - console.log(that.data.longitude, '经度') } }) }, @@ -90,34 +139,34 @@ Page({ }, //第一次数据请求 onData() { - console.log(this.data.lableArray,'分类') - let postData = { - categoryId: this.data.lableArray[0].categoryId, - page: 1, - size: 10 + console.log(this.data.lableArray, '分类') + let postData = { + categoryId: this.data.lableArray[0].categoryId, + page: 1, + size: 10 + } + method.postRequest('/goods/list', postData, data => { + if (data.statusCode == 0) { + this.setData({ + list: data.data + }) } - method.postRequest('/goods/list', postData, data => { - if (data.statusCode == 0) { - this.setData({ - list: data.data - }) - } - }) + }) }, //分类数据请求 dataRequest: function (id) { - let postData = { - categoryId: id, - page: 1, - size: 10 + let postData = { + categoryId: id, + page: 1, + size: 10 + } + method.postRequest('/goods/list', postData, data => { + if (data.statusCode == 0) { + this.setData({ + list: data.data + }) } - method.postRequest('/goods/list', postData, data => { - if (data.statusCode == 0) { - this.setData({ - list: data.data - }) - } - }) + }) }, addCart(e) { let id = e.currentTarget.dataset.id @@ -131,7 +180,7 @@ Page({ goodsData: data.data, stockNum: data.data.list[0].goodsStock }) - }else{ + } else { setTimeout(() => { util.getUser() }, 2000) @@ -229,7 +278,7 @@ Page({ url: '/pages/integral-order/integral-order', }) } - }else{ + } else { setTimeout(() => { util.getUser() }, 2000) @@ -252,10 +301,11 @@ Page({ */ onLoad: function (options) { // this.dataRequest(); + wx.removeStorageSync('categoryId') wx.removeStorageSync('index') this.catalog(); - + }, /** @@ -275,8 +325,8 @@ Page({ activeKey: index }); console.log(this.data.activeKey, 'key') - this.getLocations(); - this.location() + // this.location() + this.getSetting(); }, /** diff --git a/pages/edit-address/edit-address.js b/pages/edit-address/edit-address.js index d7aee41..fc38dc6 100644 --- a/pages/edit-address/edit-address.js +++ b/pages/edit-address/edit-address.js @@ -4,7 +4,7 @@ const util = require("../../utils/util.js"); const chooseLocation = requirePlugin('chooseLocation'); Page({ data: { - id:'', //订单id + id: '', //订单id username: '', phone: '', value: '', @@ -158,8 +158,8 @@ Page({ address: this.data.value, area: this.data.location, delFlag: delFlags, - id:this.data.id, - location: this.data.longitudes + "," + this.data.latitudes, + id: this.data.id, + location: this.data.longitudes + "," + this.data.latitudes, name: this.data.username, phone: this.data.phone, zipCode: "" @@ -186,15 +186,20 @@ Page({ } }, onLoad: function (options) { - console.log(options,'options') - this.setData({ - username: options.name, - phone: options.phone, - value: options.address, - checked: options.delFlag, - location:options.area, - id:options.id - }) + console.log(options, 'options') + this.setData({ + username: options.name, + phone: options.phone, + value: options.address, + checked: options.delFlag, + location: options.area, + locations: options.locations, + latitudes: options.locations.split(",")[0], //传值给后台 + longitudes:options.locations.split(",")[1], + id: options.id + }) + console.log(this.data.latitudes,'11') + console.log(this.data.longitudes,'222') // } }, diff --git a/pages/edit-address/edit-address.wxml b/pages/edit-address/edit-address.wxml index fb94bca..30ba7a7 100644 --- a/pages/edit-address/edit-address.wxml +++ b/pages/edit-address/edit-address.wxml @@ -1,7 +1,7 @@ <!--pages/add-address/add-address.wxml--> <view class="container"> <van-cell-group class="addContent"> - <van-field value="{{ username }}" required clearable label="姓名" icon="question-o" placeholder="请输入姓名" + <van-field value="{{ username }}" clearable label="姓名" icon="question-o" placeholder="请输入姓名" bind:click-icon="onClickIcon" bindinput="inputName" /> <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" /> <!-- 地址 --> diff --git a/pages/evaluate/evaluate.js b/pages/evaluate/evaluate.js index 07a2df5..b616078 100644 --- a/pages/evaluate/evaluate.js +++ b/pages/evaluate/evaluate.js @@ -1,18 +1,19 @@ // pages/evaluate/evaluate.js let method = require("../../utils/reuqest.js"); const util = require("../../utils/util.js"); +const ary = []; Page({ data: { - imags: [], + imgs: [], list: [], postData: [], //商品信息 word: '', length: 0, - maxlength:300, + maxlength: 300, orderId: '', checkType: 0, - ppath:[], - cpath:[], + ppath: [], + cpath: [], }, //订单信息加载 getList(orderId) { @@ -62,9 +63,18 @@ Page({ mask: true }) var uploaderList = res.tempFilePaths; - that.setData({ - imgs:uploaderList - }) + // ary.push(uploaderList[0]) + if (ary.length <= 3) { + // that.setData({ + // imgs: ary + // }) + }else{ + wx.showToast({ + title: '最多只能上传3张图片', + icon:'none' + }) + } + console.log(uploaderList, 'liost') if (type == 1) { that.setData({ @@ -99,9 +109,13 @@ Page({ }, success: function (res) { successUp++; - // console.log('上传图片成功:', JSON.parse(res.data)); + console.log('上传图片成功:', JSON.parse(res.data)); var data = JSON.parse(res.data); - let url = JSON.parse(res.data).data + let url = JSON.parse(res.data).data + ary.push(url); + that.setData({ + imgs:ary + }) if (type == 1) { that.data.ppath[i] = url; that.setData({ @@ -173,6 +187,9 @@ Page({ wx.showToast({ title: '发布成功', }), + this.setData({ + imgs:[] + }) wx.redirectTo({ url: '/pages/all-order/all-order', }) diff --git a/pages/home/home.wxml b/pages/home/home.wxml index d18d4d7..2ffadf8 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -21,13 +21,13 @@ </view> <!-- 分类 --> <view class="classify"> - <scroll-view class='wrapper' scroll-x="true"> - <view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}" data-index="{{index}}"> + <scroll-view class='wrapper1' scroll-x="true"> + <view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}" + data-index="{{index}}"> <view class="classifyPic"> <image src="{{item.icon}}"></image> </view> <view class="classifyText">{{item.categoryName}}</view> - </view> </scroll-view> </view> @@ -84,9 +84,11 @@ <view class="arrow" bindtap="morePrice"></view> </view> <view class="dayPricePicMain"> - <view wx:for="{{dayPicArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> - <image src="{{item.goodsImg}}"></image> - </view> + <scroll-view class='wrapper' scroll-x="true"> + <view wx:for="{{dayPicArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> + <image src="{{item.goodsImg}}"></image> + </view> + </scroll-view> </view> </view> <view class="mainly"> @@ -95,9 +97,11 @@ <view class="mainlyTitle">{{nameData.label}}</view> </view> <view class="dayPricePicMain"> - <view wx:for="{{marilyArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> - <image src="{{item.goodsImg}}"></image> - </view> + <scroll-view class='wrapper' scroll-x="true"> + <view wx:for="{{marilyArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> + <image src="{{item.goodsImg}}"></image> + </view> + </scroll-view> </view> </view> </view> @@ -113,12 +117,6 @@ <view class="pickTitle">{{item.goodsName}}</view> <view class="pickDesc">{{item.goodsAttributes}}</view> <view class="userInfo"> - <!-- <view class="userBox"> - <view> - <image src="{{item.headPic}}"></image> - </view> - <view class="userName">{{item.userName}}</view> - </view> --> <view class="collectIcon"> <image src="{{item.collectIcon}}"></image> <view style="display:inline-block">¥{{item.goodsPrice}}</view> diff --git a/pages/home/home.wxss b/pages/home/home.wxss index 0c25b7b..e69ebe7 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -87,7 +87,6 @@ .classify .classifyPic { width: 104rpx; height: 89rpx; - background-color: blueviolet; } .classify .classifyPic image { @@ -187,6 +186,11 @@ width: 100%; white-space: nowrap; display: flex; +} +.wrapper1 { + width: 100%; + white-space: nowrap; + display: flex; margin-top: 28rpx; } @@ -297,13 +301,15 @@ justify-content: space-between; align-items: center; margin-top: 22rpx; + width: 100%; } .dayPricePic { - width: 148rpx; + width:25%; height: 148rpx; padding: 8rpx 6rpx 8rpx 6rpx; box-sizing: border-box; + display: inline-block; } .dayPricePic image { diff --git a/pages/product-detail/product-detail.js b/pages/product-detail/product-detail.js index 5eba00c..ef8eee6 100644 --- a/pages/product-detail/product-detail.js +++ b/pages/product-detail/product-detail.js @@ -17,6 +17,7 @@ Page({ selectNum: '30', pingjiaNum: 0, infoList: [], //评价 + image:'', //评价图片 flags: true, deacArray: [{ img: '/images/1.jpg' @@ -121,11 +122,11 @@ Page({ }, //进入购物车 goCart() { - if(wx.getStorageSync('Authorization')==" "){ - setTimeout(()=>{ - util.getUser(); - },2000) - }else{ + if (wx.getStorageSync('Authorization') == " ") { + setTimeout(() => { + util.getUser(); + }, 2000) + } else { wx.switchTab({ url: '/pages/shopping-cart/shopping-cart', }) @@ -152,7 +153,7 @@ Page({ } else { wx.showToast({ title: '请先登录', - icon:'none' + icon: 'none' }) setTimeout(() => { util.getUser() diff --git a/pages/product-detail/product-detail.wxml b/pages/product-detail/product-detail.wxml index e99ae7d..b5591e1 100644 --- a/pages/product-detail/product-detail.wxml +++ b/pages/product-detail/product-detail.wxml @@ -66,13 +66,18 @@ </view> <view class="noData" wx:if="{{infoList.length==0}}">暂时没有相关商品的更多评价~</view> <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> - <view class="evaluateInfo" > + <view class="evaluateInfo"> <view class="userImg" style="display:inline-block"> <image src="{{item.wxHeadImg}}"> </image> </view> <view class="userName" style="display:inline-block">{{item.wxName}}</view> </view> <view class="evaluateDetails">{{item.content}}</view> + <view class="evaluatePic" wx:if="{{item.images}}"> + <view class="picBox" wx:for="{{item.images}}" data-item="data"> + <image src="{{item}}"></image> + </view> + </view> </view> </view> <!-- 商品明细--> diff --git a/pages/product-detail/product-detail.wxss b/pages/product-detail/product-detail.wxss index bd95625..a43ee45 100644 --- a/pages/product-detail/product-detail.wxss +++ b/pages/product-detail/product-detail.wxss @@ -306,6 +306,22 @@ letter-spacing: 1rpx; margin: 0 auto; margin-top: 20rpx; + word-break: break-all; +} + +.evaluatePic { + width: 686rpx; + height: 200rpx; + display: flex; + margin: 0 auto; +} + +.picBox { + width: 33.33%; +} +.picBox image{ + width: 100%; + height: 100%; } /* 商品详情 */ diff --git a/pages/select-address/select-address.js b/pages/select-address/select-address.js index aa743de..c91eb6a 100644 --- a/pages/select-address/select-address.js +++ b/pages/select-address/select-address.js @@ -14,8 +14,9 @@ Page({ getAddressList() { method.getRequest("/address", data => { if (data.statusCode == 0) { + let lists=data.data; this.setData({ - list: data.data + list: lists.reverse() }) } }) @@ -53,7 +54,7 @@ Page({ if (data.statusCode == 0) { wx.setStorageSync('userInfo', data) wx.navigateTo({ - url: '/pages/edit-address/edit-address?name=' + item.name + '&phone=' + item.phone + '&area=' + item.area + '&address=' + item.address + '&delFlag=' + item.delFlag+"&id="+id + url: '/pages/edit-address/edit-address?name=' + item.name + '&phone=' + item.phone + '&area=' + item.area + '&address=' + item.address + '&delFlag=' + item.delFlag+"&id="+id+'&locations='+item.location }) } else { wx.showToast({ diff --git a/pages/select-address/select-address.wxml b/pages/select-address/select-address.wxml index 5d004ec..226a49b 100644 --- a/pages/select-address/select-address.wxml +++ b/pages/select-address/select-address.wxml @@ -1,8 +1,8 @@ <!--pages/select-address/select-address.wxml--> <view class="container"> - <view class="addressBox" wx:for="{{list}}" catchtap="selectAdd" data-id="{{item.id}}" data-index="{{index}}"> - <view class="left"> + <view class="addressBox" wx:for="{{list}}" data-id="{{item.id}}" data-index="{{index}}"> + <view class="left" catchtap="selectAdd" data-id="{{item.id}}" data-index="{{index}}"> <view class="userInfo"> <view class="name">{{item.name}}</view> <view class="tell">{{item.phone}}</view> diff --git a/pages/shopping-cart/shopping-cart.js b/pages/shopping-cart/shopping-cart.js index b521ecb..198f20a 100644 --- a/pages/shopping-cart/shopping-cart.js +++ b/pages/shopping-cart/shopping-cart.js @@ -1,5 +1,6 @@ // pages/shopping-cart/shopping-cart.js let method = require("../../utils/reuqest.js") +const util = require("../../utils/util.js") Page({ data: { checkType: 1, @@ -27,6 +28,9 @@ Page({ }, //地址信息 getAddress() { + if(wx.getStorageSync('addIndex')){ + wx.setStorageSync('addIndex', 0) + } let index = wx.getStorageSync('addIndex') method.getRequest("/address", data => { if (data.statusCode == 0) { @@ -41,6 +45,26 @@ Page({ wx.navigateTo({ url: '/pages/select-address/select-address', }) + wx.setStorageSync("shopCartAdd",'true') + }, + //没有登录 + goAddress1() { + if(wx.getStorageSync('Authorization')){ + wx.navigateTo({ + url: '/pages/select-address/select-address', + }) + wx.setStorageSync("shopCartAdd",'true') + }else{ + wx.showToast({ + title: '请先登录!', + icon:'none' + }) + setTimeout(()=>{ + util.getUser(); + },2000) + + } + }, //配送时间 bindDateChange: function (e) { diff --git a/pages/shopping-cart/shopping-cart.wxml b/pages/shopping-cart/shopping-cart.wxml index 66c7943..05f28b7 100644 --- a/pages/shopping-cart/shopping-cart.wxml +++ b/pages/shopping-cart/shopping-cart.wxml @@ -1,7 +1,7 @@ <!--pages/shopping-cart/shopping-cart.wxml--> <view class="container"> <!-- 地址 --> - <view class="userInfo" bindtap="goAddress"> + <view class="userInfo" bindtap="goAddress1"> <view class="addHint" wx:if="{{addHint==false}}"> <view class="addItem1">暂未获取到收获地址</view> <view class="addItem2"> 请选择收货地址</view>