Ver código fonte

添加评论页面

wenjie 3 meses atrás
pai
commit
dd4402dc94

+ 4 - 1
app.json

@@ -71,7 +71,10 @@
     "pages/MaterialFlowInfo/MaterialFlowInfo",
     "pages/ledRedPackage/ledRedPackage",
     "pages/Review/Review",
-    "components/tabbar/tabbar"
+    "components/tabbar/tabbar",
+    "pages/setting/setting",
+    "pages/editUserName/editUserName",
+    "pages/commResult/commResult"
   ],
   "subpackages": [
     {

+ 4 - 4
components/commStar/commStar.wxss

@@ -3,11 +3,11 @@
   margin-left: 3px;
 }
 .stars image {
-  width: 35rpx;
-  height: 35rpx;
+  width: 30rpx;
+  height: 30rpx;
 }
 .stars.write image{
-  width: 40rpx;
-  height: 40rpx;
+  width: 30rpx;
+  height: 30rpx;
   margin-right:20rpx;
 }

BIN
images/icon/basket-icon.png


BIN
images/icon/car-icon.png


BIN
images/icon/comm-result.png


BIN
images/icon/empty-basket.png


BIN
images/icon/photo.png


BIN
images/icon/setting.png


BIN
images/icon/star-empty.png


BIN
images/icon/star-red.png


+ 15 - 0
pages/Review/Review.js

@@ -10,6 +10,21 @@ Page({
 
   getList(){},
 
+   /**
+   * 评价图片预览
+   */
+  comPicPreView(e){
+    var idx = e.currentTarget.dataset.idx
+    var urls = []
+    this.data.orderItemInfo.images.forEach(el => {
+      urls.push(el.url)
+    })
+    wx.previewImage({
+      current: urls[idx],
+      urls: urls
+    })
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */

+ 1 - 7
pages/Review/Review.wxml

@@ -8,14 +8,8 @@
 
           <view class="relative">
             <scroll-view class="goods-list"  scroll-x="true">
-              <!-- <image src="" mode="" class="img"/> -->
               <view class="img"></view>
-              <view class="img"></view>
-              <view class="img"></view>
-              <view class="img"></view>
-              <view class="img"></view>
-              <view class="img"></view>
-
+              <!-- <image src="{{item}}" mode="aspectFill"  class="img" wx:for="{{}}" data-idx="{{index}}" bind:tap="comPicPreView"/> -->
             </scroll-view>
               <view class="total-box">
                 <view class="price">¥13.95</view>

+ 7 - 2
pages/basket/basket.js

@@ -342,9 +342,9 @@ Page({
     var shopCartOrders = this.data.shopCartOrders;
     var shopCartItemDiscounts = shopCartOrders[topindex].shopCartItemDiscounts;
     var prodCount = shopCartItemDiscounts[scindex].shopCartItems[index].prodCount;
-    if (prodCount > 1) {
+    // if (prodCount > 1) {
       this.updateCount(shopCartOrders, topindex, scindex, index, -1);
-    }
+    // }
   },
 
   /**
@@ -561,6 +561,11 @@ Page({
       })
     }, 680)
   },
+  goShopping(){
+    wx.switchTab({
+      url: '/pages/index/index',
+    })
+  }
 
 
 

+ 5 - 3
pages/basket/basket.wxml

@@ -51,9 +51,9 @@
 											</view>
 											<view class='price-count'>
 												<view class='price'>
-													<text class='symbol'>¥</text>
-													<text class='big-num'>{{wxs.parsePrice(prod.price)[0]}}</text>
-													<text class='small-num'>.{{wxs.parsePrice(prod.price)[1]}}</text>
+													<text class=''>¥</text>
+													<text class=''>{{wxs.parsePrice(prod.price)[0]}}</text>
+													<text class=''>.{{wxs.parsePrice(prod.price)[1]}}</text>
 												</view>
 												<view class="m-numSelector"  class="num-box">
                         <image bindtap='onCountMinus' class="btn" data-topindex="{{topIndex}}" data-scindex="{{scIndex}}" data-index="{{index}}" src="/images/icon/reduce.png" mode=""/>
@@ -73,6 +73,7 @@
 
 		<!-- 底部按钮 -->
 		<view class="cart-footer" wx:if="{{shopCartOrders.length>0}}">
+      <image src="/images/icon/basket-icon.png" mode="" class="icon"/>
 			<view class="all">
 				<label bindtap='onSelAll'>
 					<checkbox checked='{{allChecked}}' color='#f7d731;' />全选</label>
@@ -153,6 +154,7 @@
 				<image src="../../images/icon/empty-basket.png"></image>
 			</view>
 			<view class="empty-text">您还没有添加商品到购物车哦~</view>
+      <view class="btn" bind:tap="goShopping">去逛逛</view>
 		</view>
 
     <tabbar class="my-tabbar" active="2" style="box-shadow: none;"></tabbar>

+ 44 - 21
pages/basket/basket.wxss

@@ -22,6 +22,7 @@ page {
   margin-top: 20rpx;
   background: #fff;
   margin: 20rpx 24rpx 0;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
 }
 
 /* 店铺 */
@@ -32,7 +33,6 @@ page {
 
 .shop-item .head-shop {
   padding: 20rpx;
-  background: #fff;
   display: flex;
   align-items: center;
 }
@@ -58,7 +58,9 @@ page {
 }
 
 .shop-item .head-shop .shop-name {
+  font-weight: bold;
   font-size: 28rpx;
+  color: #222222;
   display: -webkit-box;
   -webkit-box-orient: vertical;
   -webkit-line-clamp: 1;
@@ -123,7 +125,6 @@ page {
 }
 
 .shop-item .prod-block .item {
-  background: #fff;
   display: flex;
   align-items: center;
   padding: 20rpx;
@@ -147,8 +148,6 @@ page {
   text-align: center;
   width: 200rpx;
   height: 200rpx;
-  width: 160rpx;
-  height: 160rpx;
   line-height: 180rpx;
   font-size: 0;
 }
@@ -165,10 +164,11 @@ page {
 }
 
 .shop-item .prod-block .item .prodinfo .opt .prod-name {
-  font-size: 28rpx;
-  color: #333;
-  max-height: 72rpx;
-  line-height: 36rpx;
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+  /* max-height: 72rpx; */
+  line-height: 46rpx;
   display: -webkit-box;
   word-break: break-all;
   overflow: hidden;
@@ -239,6 +239,9 @@ page {
   justify-content: space-between;
   height: 56rpx;
   margin-top: 20rpx;
+  font-weight: bold;
+  font-size: 36rpx;
+  color: #FF4D3A;
 }
 
 /* 加减框 */
@@ -316,11 +319,16 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
   width: 100%;
   display: flex;
   align-items: center;
-  height: 90rpx;
+  height: 120rpx;
   z-index: 999;
   background: #fff;
   box-shadow: -6rpx 0 6rpx rgba(0, 0, 0, 0.1);
 }
+.cart-footer .icon{
+  width: 100rpx;
+  height: 100rpx;
+  margin-left: 20rpx;
+}
 
 .cart-footer .all {
   font-size: 28rpx;
@@ -333,21 +341,23 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
 }
 
 .cart-footer .del {
-  color: #e43130;
+  color: #FF4D3A;
   font-size: 24rpx;
-  margin-left: 20rpx;
+  margin-left: 12rpx;
 }
 
 .cart-footer .total {
   flex: 1;
   display: flex;
   align-items: center;
+  justify-content: flex-end;
   margin-left: 40rpx;
 }
 
 .cart-footer .total .total-con .finally .blod {
   font-weight: bold;
-  font-size: 28rpx;
+  font-size: 22rpx;
+  color: #222222;
 }
 
 .cart-footer .total .total-con .finally .price  {
@@ -372,14 +382,14 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
 }
 
 .cart-footer .settle {
-  height: 70rpx;
-  line-height: 70rpx;
+  height: 80rpx;
+  line-height: 80rpx;
   /* padding: 0 50rpx; */
-  width: 220rpx;
+  width: 160rpx;
   text-align: center;
   background: #006CE8;
   color: #fff;
-  border-radius: 70rpx;
+  border-radius: 40rpx;
   margin-right: 20rpx;
   font-size: 28rpx;
 }
@@ -487,8 +497,8 @@ radio .wx-radio-input{
 }
 .empty-icon {
   display: block;
-  width: 100rpx;
-  height: 100rpx;
+  width: 110rpx;
+  height: 110rpx;
   margin: 0 auto; 
   margin-bottom: 20rpx;
 }
@@ -497,10 +507,23 @@ radio .wx-radio-input{
   height: 100%;
 }
 .empty-text {
-  font-size: 28rpx;
-  text-align: center;
-  color: #999;
+  font-size: 24rpx;
+  color: #222222;
   line-height: 2em;
+  text-align: center;
+}
+.empty .btn{
+  width: 120rpx;
+  height: 48rpx;
+  line-height: 48rpx;
+  text-align: center;
+  background: #FFFFFF;
+  border-radius: 28rpx 28rpx 28rpx 28rpx;
+  border: 1rpx solid #006CE8;
+  font-weight: bold;
+  font-size: 24rpx;
+  color: #006CE8;
+  margin: 28rpx auto;
 }
 
 /* 金额明细 */

+ 5 - 5
pages/category/category.wxss

@@ -666,8 +666,8 @@ align-items: center;
 }
 .empty-icon {
   display: block;
-  width: 100rpx;
-  height: 100rpx;
+  width: 110rpx;
+  height: 110rpx;
   margin: 0 auto; 
   margin-bottom: 20rpx;
 }
@@ -676,10 +676,10 @@ align-items: center;
   height: 100%;
 }
 .empty-text {
-  font-size: 28rpx;
-  text-align: center;
-  color: #999;
+  font-size: 24rpx;
+  color: #222222;
   line-height: 2em;
+  text-align: center;
 }
 
 /* 纵向滚动容器:隐藏垂直滚动条 */

+ 5 - 5
pages/category1/category.wxml

@@ -68,7 +68,8 @@
   <!-- 滚动内容区 -->
   <view class="main" wx:if="{{categoryList.length>0}}">
     <!-- 左侧菜单start -->
-    <scroll-view scroll-y="true" class='leftmenu'  scroll-into-view="{{'item'+subIndex}}">
+    <!-- <scroll-view scroll-y="true" class='leftmenu'  scroll-into-view="{{'item'+subIndex}}"> -->
+    <scroll-view scroll-y="true" class='leftmenu' >
       <view wx:for='{{subCategoryList}}' id="{{'item'+index}}" wx:key='categoryId'>
         <view class='menu-item {{subIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onleftMenuTab'>
         <image wx:if="{{index == 0}}" class="icon" src="../../images/icon/good-icon.png" mode=""/>
@@ -83,11 +84,10 @@
 
     <!-- 右侧内容start -->
     <!-- scroll-view  -->
-    <view scroll-y="true" class='rightcontent' 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll" bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+    <view scroll-y="true" class='rightcontent' 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
       <image class="banner" src="../../images/imgs/banner.png" mode="" />
       <!-- <text wx:if="{{subCategoryList.length>0}}" class="sub-title" >{{subCategoryList[subIndex].categoryName}}</text> -->
     <view class="loading" wx:if="{{showLoading}}">
-      <!-- <van-icon class="icon" color="#006CE8" size="50rpx" name="replay" /> -->
       <image class="icon" src="../../images/imgs/loading-icon.png" mode=""/>
     </view>
       <view class="right-top-box">
@@ -107,7 +107,7 @@
           </view>
         </view>
       </view>
-      <scroll-view class="right-box"  scroll-y="true" 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+      <scroll-view class="right-box"  scroll-y="true" 	enable-passive 	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll" bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
         <view style="height:20px"></view>
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
@@ -181,7 +181,7 @@
   <view class="bottom-box">
     <view class="left" bindtap="openCar">
       <view class="num" wx:if="{{totalInfo.count}}">{{totalInfo.count}}</view>
-      <image class="icon" src="../../images/icon/car-icon.png" mode="" />
+      <image class="icon" src="/images/icon/car-btn.png" mode="" />
       <view class="price-box">
         <view class="top">
           <view class="price">¥{{totalInfo.finalMoney}}</view>

+ 5 - 5
pages/category1/category.wxss

@@ -667,8 +667,8 @@ align-items: center;
 }
 .empty-icon {
   display: block;
-  width: 100rpx;
-  height: 100rpx;
+  width: 110rpx;
+  height: 110rpx;
   margin: 0 auto; 
   margin-bottom: 20rpx;
 }
@@ -677,10 +677,10 @@ align-items: center;
   height: 100%;
 }
 .empty-text {
-  font-size: 28rpx;
-  text-align: center;
-  color: #999;
+  font-size: 24rpx;
+  color: #222222;
   line-height: 2em;
+  text-align: center;
 }
 
 /* 纵向滚动容器:隐藏垂直滚动条 */

+ 76 - 0
pages/commResult/commResult.js

@@ -0,0 +1,76 @@
+// pages/commResult/commResult.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+  goComm(){
+    wx.redirectTo({
+      url: '/pages/Review/Review',
+    })
+  },
+  goHome(){
+    wx.switchTab({
+      url: '/pages/index/index',
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/commResult/commResult.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 10 - 0
pages/commResult/commResult.wxml

@@ -0,0 +1,10 @@
+<!--pages/commResult/commResult.wxml-->
+<view class="commResult">
+  <image src="/images/icon/comm-result.png" mode="" class="icon"/>
+  <view class="title">评价成功</view>
+  <view class="desc">感谢你的评价,你为用户选择提供了真实的参考意见</view>
+  <view class="btn-box">
+    <view class="btn" bind:tap="goComm">查看评价</view>
+    <view class="btn active"  bind:tap="goHome">返回首页</view>
+  </view>
+</view>

+ 49 - 0
pages/commResult/commResult.wxss

@@ -0,0 +1,49 @@
+/* pages/commResult/commResult.wxss */
+.commResult{
+  background: linear-gradient( 180deg, #E5F1FF 0%, rgba(229,241,255,0) 406rpx,#fff 100%);
+  border-radius: 0rpx 0rpx 0rpx 0rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  height: 100vh;
+  overflow: hidden;
+}
+
+.commResult .icon{
+  width: 200rpx;
+  height: 200rpx;
+}
+
+.commResult .title{
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222;
+  margin-top: 20rpx;
+}
+
+.commResult .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
+}
+.commResult .btn-box{
+  display: flex;
+
+}
+.commResult .btn-box .btn{
+  width: 240rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  text-align: center;
+  background: #FFFFFF;
+  border-radius: 50rpx 50rpx 50rpx 50rpx;
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #222222
+}
+
+.commResult .btn-box .btn.active{
+  background: #006CE8;
+  color: #FFFFFF;
+  margin-left: 20rpx;
+}

+ 66 - 0
pages/editUserName/editUserName.js

@@ -0,0 +1,66 @@
+// pages/editUserName/editUserName.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 5 - 0
pages/editUserName/editUserName.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "修改昵称"
+
+}

+ 6 - 0
pages/editUserName/editUserName.wxml

@@ -0,0 +1,6 @@
+<!--pages/editUserName/editUserName.wxml-->
+<view class="editUserName">
+  <input type="nickname"  maxlength="{{10}}" class="weui-input" placeholder="请输入昵称"/>
+  <view class="notice">限2-10个汉字</view>
+  <view class="btn">确定</view>
+</view>

+ 32 - 0
pages/editUserName/editUserName.wxss

@@ -0,0 +1,32 @@
+/* pages/editUserName/editUserName.wxss */
+.editUserName{
+  padding: 20rpx 24rpx;
+}
+.editUserName .weui-input{
+  width: 702rpx;
+  height: 96rpx;
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  border: 2rpx solid #F0F0F0;
+  padding: 20rpx 28rpx;
+  box-sizing: border-box;
+}
+
+.editUserName .notice{
+  font-size: 28rpx;
+  color: #AAAAAA;
+  margin-top: 20rpx;
+}
+
+.editUserName .btn{
+  width: 702rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  background: #006CE8;
+  border-radius: 40rpx 40rpx 40rpx 40rpx;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FFFFFF;
+  margin-top: 20rpx;
+}

+ 2 - 1
pages/order-detail/order-detail.wxml

@@ -58,7 +58,8 @@
           申请售后
         </view>
       </view>
-      <view class="item" wx:if="{{status == 80}}" bind:tap="goWrite">
+      <view class="item" bind:tap="goWrite">
+      <!-- <view class="item" wx:if="{{status == 80}}" bind:tap="goWrite"> -->
         <image class="icon" src="../../images/icon/write.png" mode=""/>
         <view class="label">
           评价晒单

+ 47 - 66
pages/prodComm/prodComm.js

@@ -5,8 +5,13 @@ Page({
    * 页面的初始数据
    */
   data: {
-    orderItemInfo: [],  //订单列表页参数
-    submitCommCount:0 //已经提交的评论数量
+    orderItemInfo: {
+      images: [],
+      content: "",
+      score: 5,
+      isAnonymous: 1,
+      evaluate: 0,
+    },  //订单列表页参数
   },
 
   /**
@@ -14,43 +19,35 @@ Page({
    */
   onLoad: function (options) {
     // 获取上页(订单列表)数据
-    var orderItemInfo = wx.getStorageSync("orderItemInfo");
-    // console.log(orderItemInfo);
-    for (var i = 0; i < orderItemInfo.length; i++){
-      orderItemInfo[i].images = [];
-      orderItemInfo[i].content = "";
-      orderItemInfo[i].score = 5;
-      orderItemInfo[i].isAnonymous = 1;
-      orderItemInfo[i].evaluate = 0;
-    }
-    this.setData({
-      orderItemInfo: orderItemInfo
-    })
-    console.log(orderItemInfo)
+    // var orderItemInfo = wx.getStorageSync("orderItemInfo");
+    // // console.log(orderItemInfo);
+    // for (var i = 0; i < orderItemInfo.length; i++){
+    //   orderItemInfo[i].images = [];
+    //   orderItemInfo[i].content = "";
+    //   orderItemInfo[i].score = 5;
+    //   orderItemInfo[i].isAnonymous = 1;
+    //   orderItemInfo[i].evaluate = 0;
+    // }
+    // this.setData({
+    //   orderItemInfo: orderItemInfo
+    // })
+    // console.log(orderItemInfo)
   },
   
   /**
    * 发表评论
    */
   submitComm: function (e) {
-    var orderItemInfo = this.data.orderItemInfo;
-    var allFill = true;
-    for (var i = 0; i < orderItemInfo.length; i++) {
-      var cont = orderItemInfo[i].content.trim();
-      if(cont==""){
-        wx.showToast({
-          title: '评价不能为空',
-          icon:"none"
-        })
-        allFill = false;
-        break;
-      }
-    }
-    if (allFill){
-      for (var i = 0; i < orderItemInfo.length; i++) {
+      var orderItemInfo = this.data.orderItemInfo;
+        if(orderItemInfo.content.trim()==""){
+         return wx.showToast({
+            title: '评价不能为空',
+            icon:"none"
+          })
+        }
         wx.showLoading();
         var pics = '';
-        orderItemInfo[i].images.forEach(function(item){
+        orderItemInfo.images.forEach(function(item){
           pics += item.path + ',';
         });
         if(pics!=''){
@@ -61,36 +58,24 @@ Page({
           url: "/p/prodComm",
           method: "POST",
           data: {
-            content: orderItemInfo[i].content,
-            score: orderItemInfo[i].score,
-            evaluate: orderItemInfo[i].evaluate,
-            isAnonymous: orderItemInfo[i].isAnonymous,
-            orderItemId: orderItemInfo[i].orderItemId,
-            prodId: orderItemInfo[i].prodId,
+            content: orderItemInfo.content,
+            score: orderItemInfo.score,
+            evaluate: orderItemInfo.evaluate,
+            isAnonymous: orderItemInfo.isAnonymous,
+            orderItemId: orderItemInfo.orderItemId,
+            prodId: orderItemInfo.prodId,
             pics: pics
           },
           callBack:  (res) => {
-            this.setData({
-              submitCommCount: this.data.submitCommCount+1
-            });
-            if (this.data.submitCommCount == orderItemInfo.length) {
-              wx.showModal({
-                title: '',
-                content: '评价成功,感谢您!',
-                showCancel:false,
-                success(res) {
-                  wx.navigateBack();
-                }
-              })
-            }
+            
             wx.hideLoading();
+            wx.navigateTo({
+              url: '/pages/commResult/commResult',
+            })
           }
         };
         http.request(params);
-      }
-
       
-    }
   },
 
 
@@ -98,8 +83,6 @@ Page({
    * 上传图片
    */
   getUploadImg: function(e) {
-    const idx = e.target.dataset.idx
-    console.log(idx);
     var ths = this;
     wx.chooseImage({
       count: 1, // 默认9
@@ -120,7 +103,7 @@ Page({
             img.path = JSON.parse(res2).filePath;
             img.url = JSON.parse(res2).resourcesUrl + JSON.parse(res2).filePath;
             var orderItemInfo = ths.data.orderItemInfo;
-            orderItemInfo[idx].images.push(img);
+            orderItemInfo.images.push(img);
             ths.setData({
               orderItemInfo: orderItemInfo
             })
@@ -136,9 +119,8 @@ Page({
    */
   removeImage(e) {
     const idx = e.target.dataset.idx
-    const index = e.target.dataset.index
     var orderItemInfo = this.data.orderItemInfo;
-    orderItemInfo[index].images.splice(idx, 1)
+    orderItemInfo.images.splice(idx, 1)
     this.setData({
       orderItemInfo: orderItemInfo
     });
@@ -147,7 +129,7 @@ Page({
   onContentInput:function(e){
     const index = e.target.dataset.index
     var orderItemInfo = this.data.orderItemInfo;
-    orderItemInfo[index].content = e.detail.value;
+    orderItemInfo.content = e.detail.value;
     this.setData({
       orderItemInfo: orderItemInfo
     });
@@ -159,15 +141,14 @@ Page({
   * 每一项的选择事件
   */
   onSelectedItem: function (e) {
-    var index = e.target.dataset.index;// 获取data- 传进来的index
     var orderItemInfo = this.data.orderItemInfo;// 获取评论项
-    var isAnonymous = orderItemInfo[index].isAnonymous; // 获取当前评价的选中状态
+    var isAnonymous = orderItemInfo.isAnonymous; // 获取当前评价的选中状态
     if (isAnonymous==1){
       isAnonymous = 0;
     }else{
       isAnonymous = 1;
     }
-    orderItemInfo[index].isAnonymous = isAnonymous; // 改变状态
+    orderItemInfo.isAnonymous = isAnonymous; // 改变状态
     this.setData({
       orderItemInfo: orderItemInfo
     });
@@ -176,6 +157,7 @@ Page({
   onStarChange:function(e){
     var index = e.detail.idx;
     var val = e.detail.val;
+    console.log(e);
     var evaluate = 0;
     var orderItemInfo = this.data.orderItemInfo;
     if(val<3){
@@ -183,8 +165,8 @@ Page({
     }else if(val==3){
       evaluate = 1;
     }
-    orderItemInfo[index].score = val;
-    orderItemInfo[index].evaluate = evaluate;
+    orderItemInfo.score = val;
+    orderItemInfo.evaluate = evaluate;
     this.setData({
       orderItemInfo: orderItemInfo
     });
@@ -195,10 +177,9 @@ Page({
    * 评价图片预览
    */
   comPicPreView(e){
-    var index = e.currentTarget.dataset.index
     var idx = e.currentTarget.dataset.idx
     var urls = []
-    this.data.orderItemInfo[index].images.forEach(el => {
+    this.data.orderItemInfo.images.forEach(el => {
       urls.push(el.url)
     })
     wx.previewImage({

+ 33 - 41
pages/prodComm/prodComm.wxml

@@ -1,52 +1,44 @@
-<view class="container">
-
-  <view class="comm-list">
-    <view class="comm-item" wx:for="{{orderItemInfo}}">
-      <!-- 商品标题内容 -->
-      <view class="item-top">
-        <view class="top-pic">
-          <image mode="widthFix" src="{{item.pic}}"></image>
-        </view>
-        <view class="top-tit" >
-          {{item.prodName}}
-        </view>
-      </view>
-      <!-- 评价星级 -->
-      <view class="item-star">
-        <view>评分</view>
-        <comm-star value="5" type="write" index="{{index}}" bind:onStarChange="onStarChange"></comm-star>
-      </view>
-      <!-- 内容填写 -->
+<view class="">
+    <view class="box">
+       <!-- 内容填写 -->
       <view class="item-con">
-        <textarea placeholder="把使用心得分享给想买的他们吧" value="{{content}}" bindinput="onContentInput" data-index="{{index}}" maxlength="500">{{ content }}</textarea>
-      </view>
-      <!-- 添加图片 -->
-      <view class="item-pics">
-        <!-- 预览缩略图 -->
-        <view class="question-images">
-          <block wx:for="{{item.images}}" wx:key="*this" wx:for-index="idx" wx:for-item="imgItem">
-            <view class="q-image-wrap">
-              <!-- 图片缩略图  -->
-              <image class="q-image" src="{{imgItem.url}}" mode="aspectFill" data-index="{{index}}" data-idx="{{idx}}" bindtap="comPicPreView"></image>
-              <!-- 移除图片的按钮  -->
-              <view class="q-image-remover" data-idx="{{idx}}" data-index="{{index}}" bindtap="removeImage">删除</view>
-            </view>
-          </block>
-        <!-- 添加 -->
-        <view class="add-pic" data-idx="{{index}}" bindtap="getUploadImg" wx:if="{{item.images.length < 9}}">+</view>
+        <textarea placeholder="把使用心得分享给想买的他们吧" value="{{content}}" bindinput="onContentInput" data-index="{{index}}" maxlength="150">{{ content }}</textarea>
+         <!-- 添加图片 -->
+        <view class="img-box">
+          <view class="img-item"  wx:for="{{orderItemInfo.images}}" wx:key="*this" wx:for-index="idx" wx:for-item="imgItem">
+            <image src="../../images/icon/del.png" data-idx="{{idx}}" bindtap="removeImage" mode="" class="del"/>
+            <image src="{{imgItem.url}}" mode="aspectFill" class="img" data-idx="{{idx}}" bindtap="comPicPreView"/>
+          </view>
+          <view class="upload"  bindtap="getUploadImg">
+            <image src="../../images/icon/photo.png" mode="" class="photo"/>
+          </view>
         </view>
-        <!-- <view class="add-pic" bindtap="getUploadImg">+</view> -->
       </view>
-      <!-- 匿名评价 -->
-      <view class="img-tip">(最多可上传9张照片)</view>
+     
+  
+       <!-- 匿名评价 -->
+      <!-- <view class="img-tip">(最多可上传9张照片)</view> -->
       <view class="item-btm">
-        <checkbox color="red" data-index="{{index}}" bindtap="onSelectedItem" checked="{{item.isAnonymous == 1}}">匿名评价</checkbox> 
+        <checkbox bindtap="onSelectedItem" checked="{{item.isAnonymous == 1}}">匿名评价</checkbox> 
+        <view class="desc">隐藏头像和昵称</view>
       </view>
     </view>
-  </view>
+
+    <view class="box">
+        <!-- 评价星级 -->
+        <view class="item-star">
+          <view class="label">评分</view>
+          <comm-star value="5" type="write" bind:onStarChange="onStarChange"></comm-star>
+          <view class="num">{{orderItemInfo.score}}.0</view>
+        </view>
+    </view>
+   
+    
+    
+   
 
   <view class="comm-btn" bindtap="submitComm">
-    发表评价
+    发
   </view>
 
 </view>

+ 89 - 48
pages/prodComm/prodComm.wxss

@@ -1,55 +1,79 @@
 page{
   padding-bottom:90rpx;
-  background: #f4f4f4;
+  background: #F6F6F6;
+  padding: 20rpx 24rpx;
+  box-sizing: border-box;
 }
-.comm-list{
-  background: #f4f4f4;
+.box{
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  padding: 24rpx;
+  margin-bottom: 20rpx;
 }
-.comm-item{
-  margin-bottom:5px;
-  background: #fff;
-  padding:20rpx 0;
+
+.item-con{
+  position: relative;
+  background: #F6F6F6;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+
 }
-.comm-item .item-top{
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-  padding:10rpx 20rpx;
-  border-bottom:2rpx solid #f4f4f4;
+.item-con textarea{
+  width:100%;
+  height: 234rpx;
+  box-sizing: border-box;
+  padding: 24rpx;
+  font-size: 28rpx;
+
 }
-.comm-item .item-top .top-pic {
-  display: inline-block;
-  width: 90rpx;
-  height: 90rpx;
-  border-radius: 6rpx;
+
+.img-box{
+  display: flex;
+  flex-wrap: wrap;
+  padding: 0 24rpx;
+
 }
-.comm-item .item-top .top-pic image{
-  width: 100%;
-  height: 100%;
+.img-box .img-item{
+  position: relative;
+}
+.img-box .img-item .del{
+  position: absolute;
+  top: -15rpx;
+  right: 15rpx;
+  width: 30rpx;
+  height: 30rpx;
+}
+.img-box .img{
+  width: 120rpx;
+  height: 120rpx;
+  background: #FFFFFF;
+  margin-right: 34rpx;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  margin-bottom: 24rpx;
+
 }
-.comm-item .item-top .top-tit{
-  font-size:28rpx;
-  font-weight: bold;
-  white-space: nowrap;
-  text-overflow:ellipsis;
-  overflow: hidden;
-  margin-left:20rpx;
+ .upload{
+  width: 120rpx;
+  height: 120rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-bottom: 24rpx;
+  
 }
 
-.comm-item .item-con{
-  padding:20rpx;
-  font-size: 28rpx;
-}
-.comm-item .item-con textarea{
-  width:100%;
-  height:180rpx;
+.upload .photo{
+  width: 40rpx;
+  height: 40rpx;
 }
-.comm-item .item-pics{
+
+.item-pics{
   display: flex;
   padding-bottom: 15rpx;
   border: 1prpx solid #f2f2f2;
 }
-.comm-item .item-pics image{
+.item-pics image{
   width:130rpx;
   margin-left:20rpx;
 }
@@ -77,7 +101,7 @@ page{
   margin-left: 20rpx;
 }
 /*  +  */
-.comm-item .item-pics .add-pic{
+.item-pics .add-pic{
   width:130rpx;
   height:130rpx;
   line-height: 130rpx;
@@ -90,6 +114,13 @@ page{
 .item-btm{
   padding:20rpx;
   font-size: 26rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.item-btm .desc{
+  font-size: 28rpx;
+  color: #AAAAAA;
 }
 /*checkbox 选项框大小  */
 
@@ -102,8 +133,8 @@ checkbox .wx-checkbox-input {
 /*checkbox选中后样式  */
 
 checkbox .wx-checkbox-input.wx-checkbox-input-checked {
-  background: #e43130;
-  border-color: #e43130;
+  background: #006CE8;
+  border-color: #006CE8;
 }
 
 /*checkbox选中后图标样式  */
@@ -125,18 +156,28 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
   line-height: 50rpx;
   background: #fcfcfc;
 }
+.item-star .label{
+  font-size: 28rpx;
+  color: #222222;
+}
+.item-star .num{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FDD143;
+}
 comm-star{
   margin-left:20rpx;
 }
 .comm-btn{
   position: fixed;
-  bottom:0;
-  width:100%;
-  font-size: 32rpx;
-  border-top:1px solid #f4f4f4;
-  height:90rpx;
-  line-height: 90rpx;
-  color:#e43130;
+  bottom:110rpx;
+  width: 702rpx;
+  height: 100rpx;
+  line-height: 100rpx;
   text-align: center;
-  background: #fff;
+  background: #006CE8;
+  border-radius: 60rpx 60rpx 60rpx 60rpx;
+  font-weight: bold;
+  font-size: 32rpx;
+  color: #FFFFFF;
 }

+ 88 - 0
pages/setting/setting.js

@@ -0,0 +1,88 @@
+// pages/setting/setting.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    avatarUrl:wx.getStorageSync('loginResult').pic,
+    isAuthInfo:false,
+    nickName:wx.getStorageSync('loginResult').nickName
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+  onChooseAvatar(e) {
+    const { avatarUrl } = e.detail 
+    this.setData({
+      avatarUrl,
+    })
+  },
+  // 跳转编辑昵称
+  goEdit: function() {
+    if (!this.data.isAuthInfo) {
+      wx.navigateTo({
+        url: '/pages/login/login',
+      })
+      return
+    }
+    wx.navigateTo({
+      url: '/pages/editUserName/editUserName',
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    this.setData({
+      isAuthInfo: Boolean(wx.getStorageSync('loginResult').userId),
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 5 - 0
pages/setting/setting.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "账户设置"
+
+}

+ 14 - 0
pages/setting/setting.wxml

@@ -0,0 +1,14 @@
+<view class="setting">
+  <view class="box">
+    <view class="head-img-box">
+      <view class="label">头像</view>
+      <button class="head" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
+        <image class="head" src="{{avatarUrl}}"></image>
+      </button> 
+    </view>
+    <view class="name-box" bind:tap="goEdit">
+      <view class="label">昵称</view>
+      <view class="name">{{nickName}}</view>
+    </view>
+  </view>
+</view>

+ 36 - 0
pages/setting/setting.wxss

@@ -0,0 +1,36 @@
+/* pages/setting/setting.wxss */
+.setting{
+    background: #F9F9F9;
+    border-radius: 0rpx 0rpx 0rpx 0rpx;
+    height: 100vh;
+    overflow: hidden;
+    padding: 20rpx 24rpx;
+}
+.setting .box{
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  padding: 20rpx 24rpx;
+}
+
+.head-img-box,.name-box{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 14rpx 0;
+}
+.head-img-box .head{
+  width: 60rpx;
+  height: 60rpx;
+  border-radius: 50%;
+  margin: 0;
+  padding: 0;
+}
+ .label{
+  font-size: 28rpx;
+  color: #222222;
+}
+.name-box .name{
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #222222;
+}

+ 12 - 1
pages/user/user.js

@@ -280,7 +280,18 @@ Page({
       url: '/pages/delivery-address/delivery-address',
     })
   },
-
+  // 跳转账号设置
+  goSetting: function() {
+    if (!this.data.isAuthInfo) {
+      wx.navigateTo({
+        url: '/pages/login/login',
+      })
+      return
+    }
+    wx.navigateTo({
+      url: '/pages/setting/setting',
+    })
+  },
   // 跳转绑定手机号
   toBindingPhone: function() {
     wx.navigateTo({

+ 4 - 12
pages/user/user.wxml

@@ -13,18 +13,10 @@
       <view class="canpany" wx:if="{{shopName}}">
         {{shopName}}
       </view>
-      <!-- <view class="level">
-        <image class="l-bg" src="{{userLevelInfo.levelType==1?'../../images/icon/integral-icon.png':'../../images/icon/normal-icon.png'}}" role="img"></image>
-        <view class="text">{{userLevelInfo.levelType==1?userLevelInfo.levelName:'普通会员'}}</view>
-      </view> -->
-      <!-- <view class="member-integral" bindtap="toMemberInteral">
-        <image src="../../images/icon/jifen@2x.png"></image>
-        <text class="score-amount">积分:{{userLevelInfo.score?userLevelInfo.score:'0'}} <text class="arrow"></text> </text>
-      </view> -->
-      <!-- <view class="buy-member" bindtap="toBuyMember">
-        <image src="../../images/icon/goumaihuiyuan@2x.png"></image>
-        <text>购买会员</text>
-      </view> -->
+    </view>
+    <view class="set-box" bind:tap="goSetting">
+      <image class="set-icon" src="../../images/icon/setting.png" mode=""/>
+      <view class="text">账户设置</view>
     </view>
   </view>
 

+ 17 - 0
pages/user/user.wxss

@@ -122,6 +122,23 @@ page {
   height:100rpx;
   border-radius: 50%;
 }
+.userinfo-none .set-box{
+  position: absolute;
+  right: 46rpx;
+  bottom: 60rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.userinfo-none .set-box .set-icon{
+  width: 48rpx;
+  height: 48rpx;
+}
+.userinfo-none .set-box .text{
+  font-size: 24rpx;
+  color: #006CE8;
+  margin-top: 12rpx;
+}
 .score-amount{
   position: relative;
 }