Order.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="toBuy-wrap">
  3. <div class="baseInfo-wrap">
  4. <img :src="coverImg" />
  5. <div>
  6. <h5>{{title}}</h5>
  7. <p>{{produce}}</p>
  8. <span>{{price}}</span>
  9. </div>
  10. </div>
  11. <div class="flow-wrap">
  12. <el-steps :active="active" finish-status="success">
  13. <el-step title="订单选择"></el-step>
  14. <el-step title="确认支付"></el-step>
  15. <el-step title="订单完成"></el-step>
  16. </el-steps>
  17. <div class="flow-content orderCompletion">
  18. <el-button class="confrimBtn price" @click="toShow" v-show="active==2">立即评价</el-button>
  19. <qrcode
  20. :value="value"
  21. :options="{ size: 170 }">
  22. </qrcode>
  23. <p>可扫描二维码,查看订单详情</p>
  24. </div>
  25. </div>
  26. <el-dialog title="我的评价" :visible.sync="dialogTableVisible" :show-close="false">
  27. <div class="dialogheader">
  28. <el-form label-position="right" label-width="80px">
  29. <el-form-item label="评价内容">
  30. <el-input type="textarea" v-model="evaluate"></el-input>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="primary" @click="toSubmitEvaluation">提交</el-button>
  34. <el-button @click="toCancel">取消</el-button>
  35. </el-form-item>
  36. </el-form>
  37. </div>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. import QRcode from '@xkeshi/vue-qrcode'
  43. export default{
  44. data(){
  45. return{
  46. active: 0,
  47. dialogTableVisible:false,
  48. evaluate:"",
  49. value: '',
  50. coverImg:"",
  51. title:"",
  52. produce:"",
  53. price:"",
  54. madeTags:[],
  55. }
  56. },
  57. components:{
  58. qrcode:QRcode,
  59. },
  60. mounted(){
  61. this.getGoodMess();
  62. },
  63. methods:{
  64. getGoodMess(){
  65. this.axios.post(this.Api.getOrderMess,{buyerId:this.$store.state.userMess.id,id:this.$route.query.id}).then((res)=>{
  66. console.log(res.data)
  67. if(res.data.code==200){
  68. this.coverImg=res.data.res.coverImg;
  69. this.title=res.data.res.title;
  70. this.produce=res.data.res.produce;
  71. this.price=res.data.res.price;
  72. this.evaluate=res.data.res.evaluate;
  73. this.madeTags=res.data.res.madeTags;
  74. if(this.evaluate==""){
  75. this.active=2;
  76. }else{
  77. this.active=3;
  78. }
  79. //this.value="商品名称:"+this.title+";";
  80. let num=0;
  81. for(var i=0,length=this.madeTags.length;i<length;i++){
  82. // this.value+=this.madeTags[i].type+":"+this.madeTags[i].item.name+";"
  83. // this.value+="价格:"+this.madeTags[i].item.price+"元;"
  84. num+=this.madeTags[i].item.price
  85. }
  86. this.value+="price:"+num+";"
  87. }
  88. }).catch((err)=>{
  89. console.log("getShopTagList:"+err);
  90. });
  91. },
  92. next() {
  93. if (this.active++ > 2) this.active = 0;
  94. },
  95. toCancel(){
  96. this.dialogTableVisible=false;
  97. this.evaluate="";
  98. },
  99. toShow(){
  100. this.dialogTableVisible=true;
  101. },
  102. toSubmitEvaluation(){
  103. if(this.evaluate==""){
  104. this.$message.error('请输入评价内容');
  105. return;
  106. }
  107. let param={
  108. buyerId:this.$store.state.userMess.id,
  109. shopId:this.$route.query.shopId,
  110. goodId:this.$route.query.goodId,
  111. id:this.$route.query.id,
  112. comment:this.evaluate
  113. }
  114. this.axios.post(this.Api.submitEvaluation,param).then((res)=>{
  115. console.log(res.data)
  116. if(res.data.code==200){
  117. this.next();
  118. this.toCancel();
  119. }
  120. }).catch((err)=>{
  121. console.log("toSubmitEvaluation:"+err);
  122. });
  123. }
  124. }
  125. }
  126. </script>
  127. <style scoped>
  128. .toBuy-wrap{
  129. width: 100%;
  130. padding: 0 20px;
  131. }
  132. .baseInfo-wrap{
  133. width: 100%;
  134. height: 300px;
  135. margin-top: 20px;
  136. background-color: #fff;
  137. border-left: 6px solid #3eb983;
  138. padding: 20px 20px 20px 13px;
  139. }
  140. .baseInfo-wrap img{
  141. display: block;
  142. float: left;
  143. width: 260px;
  144. height: 260px;
  145. }
  146. .baseInfo-wrap div{
  147. float: left;
  148. padding-left: 20px;
  149. text-align: left;
  150. width: calc(100% - 260px);
  151. }
  152. .baseInfo-wrap h5{
  153. font-size: 30px;
  154. margin-bottom: 10px;
  155. }
  156. .baseInfo-wrap p{
  157. font-size: 16px;
  158. color: #666;
  159. width: 100%;
  160. height: 100px;
  161. }
  162. .baseInfo-wrap span{
  163. font-size: 30px;
  164. color: #EA6A69;
  165. line-height: 65px;
  166. display: block;
  167. }
  168. .flow-wrap{
  169. width: 100%;
  170. height: auto;
  171. margin-top: 20px;
  172. background-color: #fff;
  173. padding: 20px;
  174. }
  175. .flow-content{
  176. width: 600px;
  177. margin: 40px auto 0;
  178. }
  179. .confrimBtn{
  180. background-color: #3eb983;
  181. border-color: #3eb983;
  182. color: #fff;
  183. padding: 10px 40px;
  184. }
  185. .price{
  186. margin-top: 20px;
  187. }
  188. .orderCompletion{
  189. text-align: center;
  190. }
  191. .orderCompletion img{
  192. width: 180px;
  193. }
  194. .orderCompletion p{
  195. color: #3eb983;
  196. font-size: 18px;
  197. line-height: 30px;
  198. }
  199. </style>
  200. <style>
  201. .el-step__head{
  202. text-align: left;
  203. }
  204. .el-step__head.is-success{
  205. color: #3eb983;
  206. border-color: #3eb983;
  207. }
  208. .el-step__title.is-success{
  209. color: #3eb983;
  210. }
  211. </style>