lookProduct.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <el-dialog
  3. :visible.sync="dialogVisible"
  4. width="20%"
  5. :before-close="closeDialog"
  6. custom-class="phone"
  7. :destroy-on-close="true"
  8. >
  9. <phoneView>
  10. <div slot="conts">
  11. <div>
  12. <el-carousel height="200px">
  13. <el-carousel-item v-for="(item, index) in headerImg" :key="index">
  14. <el-image
  15. v-if="item.type == 'img'"
  16. style="width: 100%; height: 200px"
  17. :src="item.src"
  18. :preview-src-list="[item.src]"
  19. >
  20. </el-image>
  21. <video
  22. v-if="item.type == 'video'"
  23. :key="index"
  24. controls
  25. :src="item.src"
  26. style="width: 100%; height: 200px"
  27. ></video>
  28. </el-carousel-item>
  29. </el-carousel>
  30. </div>
  31. <img
  32. style="width: 100%"
  33. src="https://bucket.sxdirectpurchase.com/fileUpload/test/47fc6132-0b3e-4b5c-b858-f78d363eba90.png"
  34. alt=""
  35. />
  36. <div class="card">
  37. <div class="spuName">{{ form ? form.title : "" }}</div>
  38. <div class="price_info">
  39. <div class="price_group">
  40. <span>¥</span
  41. ><span class="price"
  42. >{{
  43. form.skuList
  44. ? form.skuList[0].skuPriceList
  45. ? form.skuList[0].skuPriceList[0].price
  46. : 0
  47. : 0
  48. }}元</span
  49. ><span>/{{ form.unit }}</span>
  50. </div>
  51. <span class="ys">已售 0</span>
  52. </div>
  53. </div>
  54. <div class="card" style="margin-top: 10px">
  55. <div class="spuName">规格/价格</div>
  56. <div v-for="(item, index) in form.skuList" :key="index">
  57. <div class="price_info">
  58. <span
  59. >{{ item.skuSpecsList ? item.skuSpecsList[0].specsName : "" }}
  60. {{ item.skuSpecsList ? item.skuSpecsList[0].specsValue : "" }}</span
  61. >
  62. </div>
  63. <div
  64. style="display: flex; flex-direction: row; justify-content: space-between"
  65. >
  66. <span style="font-size: 14px; color: red">
  67. <span>¥</span>
  68. <span>{{ item.skuPriceList ? item.skuPriceList[0].price : 0 }}元</span
  69. ><span>/{{ form.unit }}</span></span
  70. >
  71. <span style="font-size: 14px"
  72. >{{ item.skuPriceList ? item.skuPriceList[0].minPurchase : 0 }}/{{
  73. form.unit
  74. }}起购</span
  75. >
  76. <span style="font-size: 14px">库存:{{ item.stock }}{{ form.unit }}</span>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="card" style="margin-top: 10px">
  81. <el-form
  82. :model="form"
  83. ref="queryForm"
  84. size="small"
  85. :inline="true"
  86. label-width="80px"
  87. label-position="left"
  88. >
  89. <el-row>
  90. <el-col :span="24">
  91. <el-form-item label="发货地" prop="spuName">
  92. <div style="width: 185px">
  93. {{ form.shippingAddrBean ? form.shippingAddrBean.addr : "" }}
  94. {{ form.shippingAddrBean ? form.shippingAddrBean.addrDetail : "" }}
  95. </div>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="24">
  99. <el-form-item label="发货时间" prop="spuName">
  100. {{ form.shippingTimeDesc }}
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="24">
  104. <el-form-item label="商品属性" prop="spuName">
  105. <div>查看></div>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="24">
  109. <el-form-item label="包装方式" prop="spuName">
  110. {{ form.packing }}
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. </div>
  116. <div class="card" style="margin-top: 10px">
  117. <div
  118. style="
  119. display: flex;
  120. flex-direction: row;
  121. justify-content: space-between;
  122. align-items: center;
  123. "
  124. >
  125. <span class="spuName">商品评价</span>
  126. <span>好评率 <span style="color: red">100%</span></span>
  127. </div>
  128. <div
  129. style="
  130. display: flex;
  131. flex-direction: column;
  132. justify-content: center;
  133. align-items: center;
  134. "
  135. >
  136. <img
  137. style="width: 40%"
  138. src="https://directpurchase-oss-dev.oss-cn-chengdu.aliyuncs.com/wx/static/images/kong.png"
  139. alt=""
  140. />
  141. <span>还没有评价~</span>
  142. </div>
  143. </div>
  144. <div class="card" style="margin-top: 10px">
  145. <div class="spuName">商品介绍</div>
  146. <div style="font-size: 14px; line-height: 25px">
  147. {{ form.spuDesc }}
  148. </div>
  149. </div>
  150. <div class="card" style="margin-top: 10px">
  151. <div class="spuName">商品详情</div>
  152. <div style="font-size: 14px; line-height: 25px">
  153. <el-image
  154. v-for="(item, index) in form.spuDetailList"
  155. :key="index"
  156. :src="item.fileUrl"
  157. fit="fill"
  158. :preview-src-list="[item.fileUrl]"
  159. >
  160. </el-image>
  161. </div>
  162. <div style="font-size: 14px; line-height: 25px">
  163. <el-image
  164. v-for="(item, index) in form.specialList"
  165. :key="index"
  166. :src="item.fileUrl"
  167. fit="fill"
  168. :preview-src-list="[item.fileUrl]"
  169. >
  170. </el-image>
  171. </div>
  172. </div>
  173. </div>
  174. </phoneView>
  175. </el-dialog>
  176. </template>
  177. <script>
  178. import phoneView from "@/components/phoneView/index.vue";
  179. export default {
  180. components: { phoneView },
  181. data() {
  182. return {
  183. dialogVisible: false,
  184. form: {},
  185. headerImg: [],
  186. };
  187. },
  188. methods: {
  189. openDialog(record) {
  190. this.form = record;
  191. this.headerImg = [];
  192. if (this.form.vid) {
  193. this.headerImg.push({
  194. type: "video",
  195. src: this.form.vid,
  196. sort: 1,
  197. });
  198. }
  199. if (this.form.pic) {
  200. this.headerImg.push({
  201. type: "img",
  202. src: this.form.pic,
  203. sort: 2,
  204. });
  205. }
  206. this.headerImg = this.unique(this.headerImg);
  207. if (this.form.bannerList) {
  208. this.form.bannerList.forEach((e, index) => {
  209. this.headerImg.push({
  210. type: "img",
  211. src: e.fileUrl,
  212. sort: index + 4,
  213. });
  214. });
  215. }
  216. this.headerImg.sort((a, b) => a.sort - b.sort); //排序 视频在最前面>封面>商品banner
  217. this.dialogVisible = true;
  218. },
  219. unique(arr) {
  220. const res = new Map();
  221. return arr.filter((arr) => !res.has(arr.src) && res.set(arr.src, 1));
  222. },
  223. closeDialog() {
  224. this.dialogVisible = false;
  225. },
  226. },
  227. };
  228. </script>
  229. <style scoped>
  230. /deep/ .el-dialog {
  231. background: transparent !important;
  232. /* margin: 0px !important; */
  233. box-shadow: none !important;
  234. padding: 0px !important;
  235. }
  236. /deep/ .el-dialog__body {
  237. margin: 0px !important;
  238. padding: 0px !important;
  239. }
  240. /deep/ .el-dialog__header {
  241. margin: 0px !important;
  242. padding: 0px !important;
  243. }
  244. /deep/ .phone {
  245. margin: auto;
  246. }
  247. /* .phone /deep/ .el-dialog__headerbtn {
  248. border-radius: 50%;
  249. width: 30px !important;
  250. height: 30px !important;
  251. background: #fff !important;
  252. top: -5px !important;
  253. right: 6px !important;
  254. display: flex;
  255. flex-direction: row;
  256. align-items: center;
  257. justify-content: center;
  258. } */
  259. .card {
  260. /* height: 85px; */
  261. width: 95%;
  262. background: white;
  263. margin: auto;
  264. border-radius: 10px;
  265. line-height: 30px;
  266. padding: 10px;
  267. }
  268. .spuName {
  269. text-decoration: none;
  270. font-weight: bold;
  271. word-wrap: normal;
  272. font-size: 18px;
  273. color: #333333;
  274. }
  275. .price_group {
  276. color: #ff2f2f;
  277. }
  278. .price {
  279. text-decoration: none;
  280. font-weight: bold;
  281. word-wrap: normal;
  282. font-size: 25px;
  283. color: #ff2f2f;
  284. }
  285. .price_info {
  286. display: flex;
  287. flex-direction: row;
  288. justify-content: space-between;
  289. align-items: center;
  290. }
  291. .ys {
  292. font-size: 14px;
  293. }
  294. </style>