OrderEvaluate.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view class="div container">
  3. <!-- header -->
  4. <view class="div common-header-wrap">
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="评价订单" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <!-- body -->
  14. <view class="div body main-content pb-10">
  15. <view
  16. class="div order-comment-body"
  17. v-for="(item, index) in orderItem"
  18. v-if="orderItem.length > 0"
  19. :key="index"
  20. >
  21. <view class="div body-list">
  22. <view class="div image">
  23. <image mode="aspectFit" class="img"
  24. v-bind:src="item.goods_image_url"
  25. />
  26. </view>
  27. <view class="div comment">
  28. <text class="span">{{ item.goods_name }}</text>
  29. <uni-rate :size="18" v-model="result.goods[item.goods_id].score"/>
  30. </view>
  31. </view>
  32. <view class="div enter">
  33. <textarea
  34. placeholder="请在此输入评价"
  35. v-model="result.goods[item.goods_id].comment"
  36. ></textarea>
  37. </view>
  38. </view>
  39. <view v-if="!store_info.is_platform_store" class="div store-evaluate">
  40. <view class="div title">店铺评价</view>
  41. <view class="div comment">
  42. <text class="span">描述相符</text>
  43. <uni-rate :size="18" v-model="store_desccredit"/>
  44. </view>
  45. <view class="div comment">
  46. <text class="span">服务态度</text>
  47. <uni-rate :size="18" v-model="store_servicecredit"/>
  48. </view>
  49. <view class="div comment">
  50. <text class="span">发货速度</text>
  51. <uni-rate :size="18" v-model="store_deliverycredit"/>
  52. </view>
  53. </view>
  54. <view class="div common-btn ds-button-large" @click="submit">提交</view>
  55. </view>
  56. </view></member-base>
  57. </template>
  58. <script>
  59. import {getFontSize} from '@/util/common'
  60. import TitleHeader from '../../TitleHeader'
  61. import { urlencode } from '@/util/common'
  62. import MemberBase from '../MemberBase'
  63. import { getOrderEvaluateInfo, saveOrderEvaluate } from '../../../api/memberOrder'
  64. export default {
  65. mounted(){
  66. // #ifdef MP-WEIXIN
  67. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  68. // #endif
  69. },
  70. computed:{
  71. fontSize(){
  72. return getFontSize()
  73. },
  74. },
  75. data(){
  76. return {
  77. navHeight: 0,
  78. order_id:0,
  79. store_info:{},
  80. orderItem: {},
  81. result: { goods: {} },
  82. score: [],
  83. store_desccredit: 5,
  84. store_servicecredit: 5,
  85. store_deliverycredit: 5
  86. }
  87. },
  88. components:{
  89. TitleHeader,
  90. MemberBase,
  91. },
  92. onLoad: function (option) {
  93. this.order_id=option.order_id
  94. if (this.order_id) {
  95. getOrderEvaluateInfo(option.order_id).then(res => {
  96. this.orderItem = res.result.order_goods
  97. this.store_info=res.result.store_info
  98. for (var i in this.orderItem) {
  99. this.result.goods[this.orderItem[i].goods_id] = { comment: '', score: 5 }
  100. this.score[i] = 5
  101. }
  102. }).catch(function (error) {
  103. uni.showToast({icon:'none',title: error.message})
  104. })
  105. }
  106. },
  107. methods:{
  108. goBack(){uni.navigateBack({delta:1})},
  109. submit () {
  110. this.result['store_desccredit']=this.store_desccredit
  111. this.result['store_servicecredit']=this.store_servicecredit
  112. this.result['store_deliverycredit']=this.store_deliverycredit
  113. saveOrderEvaluate(this.order_id, this.result).then(res => {
  114. uni.navigateTo({ url: '/pages/member/order/OrderList'+'?'+urlencode( { state: 'state_noeval' } )})
  115. }).catch(function (error) {
  116. uni.showToast({icon:'none',title: error.message})
  117. })
  118. },
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .common-score-wrapper .back{display: block}
  124. .main-content{padding: 0 $pageSpace;background: #fff;box-sizing: border-box;}
  125. .container {
  126. display: flex;
  127. flex-direction: column;
  128. justify-content: flex-start;
  129. align-items: stretch;
  130. .body {
  131. top: 2.2rem;
  132. width: 100%;
  133. .store-evaluate{padding:.5rem 0;background: #fff;font-size:$subFontSize;
  134. .title{line-height: 2rem;border-top:1px solid #e1e1e1;font-size:$h2;}
  135. .common-score-wrapper{margin-left:.5rem;}
  136. }
  137. .order-comment-body {
  138. background: rgba(255, 255, 255, 1);
  139. padding: 0.75rem 0;
  140. .body-list {
  141. display: flex;
  142. justify-content: left;
  143. align-content: center;
  144. align-items: center;
  145. }
  146. .image {
  147. width: 3.75rem;
  148. height: 3.75rem;
  149. flex-shrink: 0;
  150. .img {
  151. width: 100%;
  152. height: 100%;
  153. }
  154. }
  155. .comment {
  156. flex-basis: 100%;
  157. padding-left: 0.75rem;
  158. .span {
  159. font-size:$h2;
  160. color: #7c7f88;
  161. text-align: left;
  162. display: block;
  163. }
  164. .ul {
  165. display: flex;
  166. justify-content: space-between;
  167. align-content: center;
  168. align-items: center;
  169. margin-top: 1.2rem;
  170. .li {
  171. .img {
  172. width: 0.95rem;
  173. height: 0.95rem;
  174. flex-shrink: 0;
  175. }
  176. label {
  177. font-size:$subFontSize;
  178. color: rgba(78, 84, 93, 1);
  179. font-weight: normal;
  180. }
  181. }
  182. }
  183. }
  184. .enter {
  185. padding-top: 0.75rem;
  186. textarea {
  187. width: 100%;
  188. height: 6rem;
  189. background: rgba(247, 249, 250, 1);
  190. border: 1px solid #f7f9fa;
  191. box-sizing: border-box;
  192. padding: 0.5rem 0 0 0.5rem;
  193. font-size:$subFontSize;
  194. -webkit-appearance: none;
  195. outline: none;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. </style>