appraise.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <view>
  3. <!--标题栏-->
  4. <bar-title bgColor="bg-white" isBack>
  5. <block slot="content">交易评价</block>
  6. </bar-title>
  7. <!--提示栏-->
  8. <!-- <view class="bg-red light text-sm zaiui-tip-view">
  9. <view class="text-cut content">对方做出评价前,不会看到您的评价内容哦~</view>
  10. <text class="cuIcon-close icon"/>
  11. </view> -->
  12. <view class="cu-form-group margin-top" v-if="info.detail && info.detail.length > 1">
  13. <view class="title">选择商品</view>
  14. <picker @change="expressPickerChange" :value="goodsIndex" :range="info.detail" range-key="name">
  15. <view class="picker">
  16. {{info.detail[goodsIndex] && info.detail[goodsIndex].name}}
  17. </view>
  18. </picker>
  19. </view>
  20. <!--商品信息-->
  21. <view class="bg-white padding-sm zaiui-goods-info-view margin-bottom">
  22. <view class="cu-avatar round lg" :style="[{backgroundImage:'url('+ curGoods.pic +')'}]"/>
  23. <view class="goods-info-view">
  24. <view class="text-cut text-black text-lg">{{curGoods.name}}</view>
  25. <view class="text-cut text-gray">{{curGoods.sku_name}}</view>
  26. </view>
  27. </view>
  28. <!--信息-->
  29. <view class="bg-white zaiui-content-view">
  30. <!--评分-->
  31. <!-- <view class="zaiui-score-view">
  32. <view class="item-score">
  33. <view class="text-cut text-view">再次与TA交易</view>
  34. <view class="score-img-view">
  35. <view class="img-view">
  36. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a1.png')"/>
  37. <view class="text-gray text-center title">不愿意</view>
  38. </view>
  39. <view class="img-view">
  40. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a2.png')"/>
  41. <view class="text-gray text-center title">一般</view>
  42. </view>
  43. <view class="img-view">
  44. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a3s.png')"/>
  45. <view class="text-gray text-center title">愿意</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="item-score">
  50. <view class="text-cut text-view">沟通愉快程度</view>
  51. <view class="score-img-view">
  52. <view class="img-view">
  53. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a1.png')"/>
  54. <view class="text-gray text-center title">不开心</view>
  55. </view>
  56. <view class="img-view">
  57. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a2s.png')"/>
  58. <view class="text-gray text-center title">一般</view>
  59. </view>
  60. <view class="img-view">
  61. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a3.png')"/>
  62. <view class="text-gray text-center title">开心</view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="item-score">
  67. <view class="text-cut text-view">实物与描述一致度</view>
  68. <view class="score-img-view">
  69. <view class="img-view">
  70. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a1s.png')"/>
  71. <view class="text-gray text-center title">不一致</view>
  72. </view>
  73. <view class="img-view">
  74. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a2.png')"/>
  75. <view class="text-gray text-center title">一般</view>
  76. </view>
  77. <view class="img-view">
  78. <view class="cu-avatar sm" style="background-image:url('/static/zaiui/img/a3.png')"/>
  79. <view class="text-gray text-center title">一致</view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. -->
  85. <!--评价内容-->
  86. <view class="cu-form-group solid-top">
  87. <textarea placeholder="随手评价,造福你我他" v-model="content"/>
  88. </view>
  89. <!-- <view class="zaiui-img-view">
  90. <view class="img-grid-view">
  91. <view class="grid col-5">
  92. <block v-for="(item,index) in imgList" :key="index">
  93. <view class="bg-img" @tap="ViewImage" :data-url="imgList[index]">
  94. <image class="image" :src="imgList[index]" mode="aspectFill"></image>
  95. <view class="cu-tag sm bg-red" @tap.stop="DelImg" :data-index="index">
  96. <text class='cuIcon-close'></text>
  97. </view>
  98. </view>
  99. </block>
  100. <view class="add-view" @tap="ChooseImage">
  101. <text class='cuIcon-add'></text>
  102. </view>
  103. </view>
  104. </view>
  105. </view> -->
  106. </view>
  107. <!--按钮-->
  108. <view class="bg-white zaiui-btn-view zaiui-foot-padding-bottom">
  109. <view class="flex flex-direction">
  110. <button class="cu-btn bg-red" @click="submit">提交评价</button>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. import barTitle from '@/components/zaiui-common/basics/bar-title';
  117. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  118. export default {
  119. components: {
  120. barTitle
  121. },
  122. data() {
  123. return {
  124. id: '',
  125. info: {},
  126. bg_img: '/static/images/home/goods/1.png', imgList: [],
  127. content: '',
  128. goodsIndex: 0
  129. }
  130. },
  131. computed: {
  132. curGoods() {
  133. if(!this.info.detail) return {}
  134. return this.info.detail && this.info.detail.length > 1 ? this.info.detail[this.goodsIndex] : this.info.detail[0]
  135. }
  136. },
  137. onLoad(options) {
  138. this.id = options.id;
  139. this.loadInfo()
  140. },
  141. onReady() {
  142. _tool.setBarColor(true);
  143. uni.pageScrollTo({
  144. scrollTop: 0,
  145. duration: 0
  146. });
  147. },
  148. methods: {
  149. loadInfo() {
  150. this.reqByuser({
  151. url: '?l=resource.getOrderView',
  152. data: {
  153. type: 3,
  154. id: this.id
  155. },
  156. success: res => {
  157. if(res.data.status == 1) {
  158. this.info = res.data.data.info;
  159. }else {
  160. uni.showToast({
  161. icon: 'error',
  162. title: res.data.msg
  163. })
  164. }
  165. }
  166. })
  167. },
  168. submit() {
  169. this.reqByuser({
  170. url: '?l=review.up',
  171. data: {
  172. type: 3,
  173. type_id: this.curGoods.id,
  174. content: this.content
  175. },
  176. success: res => {
  177. if(res.data.status == 1) {
  178. uni.showToast({
  179. icon: 'success',
  180. title: '提交成功'
  181. })
  182. setTimeout(() => {
  183. uni.navigateBack()
  184. }, 1000)
  185. }else {
  186. uni.showToast({
  187. icon: 'error',
  188. title: res.data.msg
  189. })
  190. }
  191. }
  192. })
  193. },
  194. ChooseImage() {
  195. uni.chooseImage({
  196. count: 4,
  197. sizeType: ['original', 'compressed'],
  198. sourceType: ['album'],
  199. success: (res) => {
  200. if (this.imgList.length != 0) {
  201. this.imgList = this.imgList.concat(res.tempFilePaths)
  202. } else {
  203. this.imgList = res.tempFilePaths
  204. }
  205. }
  206. });
  207. },
  208. ViewImage(e) {
  209. uni.previewImage({
  210. urls: this.imgList,
  211. current: e.currentTarget.dataset.url
  212. });
  213. },
  214. DelImg(e) {
  215. uni.showModal({
  216. title: '召唤师',
  217. content: '确定要删除这段回忆吗?',
  218. cancelText: '再看看',
  219. confirmText: '再见',
  220. success: res => {
  221. if (res.confirm) {
  222. this.imgList.splice(e.currentTarget.dataset.index, 1)
  223. }
  224. }
  225. })
  226. },
  227. }
  228. }
  229. </script>
  230. <style lang="scss">
  231. /* #ifdef APP-PLUS */
  232. @import "../../static/colorui/main.css";
  233. @import "../../static/colorui/icon.css";
  234. @import "../../static/zaiui/style/app.scss";
  235. /* #endif */
  236. .zaiui-goods-info-view {
  237. position: relative;
  238. .cu-avatar {
  239. position: absolute;
  240. }
  241. .goods-info-view {
  242. position: relative;
  243. padding-left: 112.72upx;
  244. height: 94.54upx;
  245. line-height: 1.7;
  246. }
  247. }
  248. .zaiui-score-view {
  249. position: relative;
  250. padding: 25.45upx 27.27upx 0;
  251. .item-score {
  252. position: relative;
  253. height: 118.18upx;
  254. .text-view {
  255. position: relative;
  256. padding-right: 290.9upx;
  257. top: 18.18upx;
  258. }
  259. .score-img-view {
  260. position: absolute;
  261. display: flex;
  262. right: 0;
  263. top: 0;
  264. .img-view {
  265. position: relative;
  266. text-align: center;
  267. width: 72.72upx;
  268. .title {
  269. margin-top: 5.45upx;
  270. font-size: 20upx;
  271. }
  272. }
  273. .img-view + .img-view {
  274. margin-left: 18.18upx;
  275. }
  276. }
  277. }
  278. }
  279. .zaiui-img-view {
  280. position: relative;
  281. padding: 0 29.09upx;
  282. .img-grid-view {
  283. position: relative;
  284. padding-right: 72.72upx;
  285. padding-bottom: 18.18upx;
  286. .grid.col-5 {
  287. .bg-img {
  288. position: relative;
  289. border-radius: 3.63upx;
  290. margin-bottom: 27.27upx;
  291. margin-right: 27.27upx;
  292. height: 72.72upx;
  293. width: 72.72upx;
  294. .image {
  295. border-radius: 3.63upx;
  296. height: 72.72upx;
  297. width: 72.72upx;
  298. }
  299. .cu-tag {
  300. position: absolute;
  301. border-radius: 3.63upx;
  302. padding: 0 1.81upx;
  303. height: auto;
  304. right: 0;
  305. top: 0;
  306. text {
  307. position: relative;
  308. top: 1.81upx;
  309. }
  310. }
  311. }
  312. .add-view {
  313. border: 2upx solid #efeeee;
  314. margin-bottom: 27.27upx;
  315. border-radius: 3.63upx;
  316. line-height: 72.72upx;
  317. text-align: center;
  318. height: 72.72upx;
  319. width: 72.72upx;
  320. text {
  321. position: relative;
  322. font-size: 54.54upx;
  323. color: #e4e3e3;
  324. }
  325. }
  326. }
  327. }
  328. }
  329. .zaiui-btn-view {
  330. position: fixed;
  331. width: 100%;
  332. bottom: 0;
  333. .flex {
  334. padding: 18.18upx;
  335. }
  336. }
  337. </style>