goods-import-detail.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('选品详情'))
  4. <style>
  5. @font-face {
  6. font-family: 'iconfont'; /* Project id 2964543 */
  7. src: url('//at.alicdn.com/t/font_2964543_dkjt7f4ser.woff2?t=1637810602268') format('woff2'),
  8. url('//at.alicdn.com/t/font_2964543_dkjt7f4ser.woff?t=1637810602268') format('woff'),
  9. url('//at.alicdn.com/t/font_2964543_dkjt7f4ser.ttf?t=1637810602268') format('truetype');
  10. }
  11. [v-cloak]{
  12. display:none;
  13. }
  14. .content{background-color: #eff3f6;}
  15. .detail-box{background-color: #fff;margin:0 20px;padding:20px;border-radius: 8px;}
  16. .detail-title{border: solid 1px #dbdbdb;padding:10px;display: flex;}
  17. .goods-img{width:370px;height: 370px;border: 1px solid #c9c9c9;}
  18. .goods-img-item{width:370px;margin-top:20px;position: relative;height:70px;overflow: hidden;}
  19. .img:nth-child(n+1){margin-right:5px;}
  20. /* .img:nth-child(5n){margin-right:0;} */
  21. .control-img{opacity:0;transition: all .6s;height:100%;color:#fff;font-weight:600;background:#000;position: absolute;width:20px;z-index:2;line-height:70px;text-align:center;border: 1px solid #c9c9c9;}
  22. .img-left{left:0;}
  23. .img-right{right:0;}
  24. .small-img{position: absolute;width:100%;height:100%;transition: all 1s;}
  25. .goods-img-item:hover .control-img{opacity:.4;}
  26. .Price-box{width:700px;line-height: 50px;background-color: #cc472e;display:flex;color:#fff;font-weight:600;margin:20px 0;border-radius: 4px;}
  27. .select{
  28. display: inline-block;
  29. line-height: 1;
  30. white-space: nowrap;
  31. cursor: pointer;
  32. background: #FFF;
  33. border: 1px solid #cbcbcb;
  34. color: #949393;
  35. -webkit-appearance: none;
  36. text-align: center;
  37. -webkit-box-sizing: border-box;
  38. box-sizing: border-box;
  39. outline: 0;
  40. margin: 0;
  41. -webkit-transition: .1s;
  42. transition: .1s;
  43. font-weight: 500;
  44. padding: 12px 20px;
  45. font-size: 14px;
  46. border-radius: 4px;
  47. position: relative;
  48. margin:0 0 10px 10px;
  49. }
  50. .change{
  51. color: #44be95;
  52. border-color: #44be95;
  53. }
  54. .el-carousel__container{height: 70px;}
  55. .description{width: 100%;margin-top: 20px;}
  56. .description img{
  57. width: 100%;
  58. }
  59. </style>
  60. <div class="all">
  61. <div id="app" v-cloak>
  62. <div class="right-titpos">
  63. <ul class="add-snav">
  64. <li class="active"><a href="{!! yzWebUrl('plugin.jd-supply.admin.goods-import.index') !!}">选品中心</a></li>
  65. <li class="active">[[detail.title]]</li>
  66. </ul>
  67. </div>
  68. <div class="detail-box">
  69. <div class="detail-title">
  70. <div class="goods-img-box">
  71. <img v-if="detail.covers" :src="detail.cover" class="goods-img">
  72. <div class="goods-img-item">
  73. <div v-if="detail.covers&&detail.covers.length" style="left:0;" class="control-img el-icon-arrow-left" @click="controlImg(selectImg+5)"></div>
  74. <div class="small-img" style="left:0px;white-space:nowrap;" v-if="detail.covers">
  75. <img class="img" @click="controlImg(i)" v-for="(item,i) in detail.covers" :src="item" width="70px" height="70px" :style="{border:selectImg==i?'1px solid red':''}">
  76. </div>
  77. <div v-if="detail.covers&&detail.covers.length" style="right:0;" class="control-img el-icon-arrow-right" @click="controlImg(selectImg-5)"></div>
  78. </div>
  79. <div style="width: 100%;display:flex;margin:20px 0;font-size:16px;color: #6b6b6b;">
  80. <div style="width: 50%;border-right:1px solid #ccc;">编号:[[detail.third_id]]</div>
  81. <div style="width: 50%;;text-align: center;">sku:[[detail.id]]</div>
  82. </div>
  83. </div>
  84. <div style="margin-left:40px;">
  85. <div style="color: #333;font-size: 22px;margin:20px 0;">[[detail.title||'商品名']]</div>
  86. <div class="Price-box">
  87. <div style="margin:0 60px 0 20px;">
  88. 协议价<span style="margin:0 10px 0 20px;font-size:20px;">¥[[(detail.agreement_price/100).toFixed(2)]]</span>
  89. <span style="text-decoration:line-through;">¥[[(detail.market_price/100).toFixed(2)]]</span></div>
  90. <div>营销价 :¥[[(detail.activity_price/100).toFixed(2)]]</div>
  91. </div>
  92. <div style="display:flex;text-align:center;margin:20px 0;font-size:16px;">
  93. <div style="width:140px;">
  94. <div>
  95. <img style="margin-bottom: 12px;" width="23px" height="27px" src="{{resource_get('plugins/jd-supply/assent/image/已售出@2x.png')}}">
  96. <span style="color: #202020;font-size:16px;">已售出</span>
  97. </div>
  98. <div>[[detail.sale]]</div>
  99. </div>
  100. <div style="width:140px;border-left:1px solid #e3e3e3;border-right:1px solid #e3e3e3;">
  101. <div>
  102. <img style="margin-bottom: 12px;" width="28px" height="28px" src="{{resource_get('plugins/jd-supply/assent/image/评价@2x.png')}}">
  103. <span style="font-size:16px;">评价</span>
  104. </div>
  105. <div>
  106. <el-rate v-model="rate" disabled text-color="#ccc" disabled-void-color="#ccc" ></el-rate>
  107. </div>
  108. </div>
  109. <div style="width:140px;">
  110. <div>
  111. <img style="margin-bottom: 12px;" width="27px" height="27px" src="{{resource_get('plugins/jd-supply/assent/image/fontclass-kucun.png')}}">
  112. <span style="color: #202020;font-size:16px;">库存</span>
  113. </div>
  114. <div>[[stock>100?"100+":stock]]</div>
  115. </div>
  116. </div>
  117. <el-form ref="form" label-width="80px">
  118. <el-form-item label="配送至:">
  119. <div style="width:700px;display:flex;margin-left:10px;">
  120. <el-cascader @change="getstatus" v-model="value" :options="area" :props="props" ></el-cascader>
  121. <div style="margin-left:80px"><span style="margin-right:20px;">[[status==1?"有货":"无货"]]</span>
  122. <span>[[detail.source=="1"?'云仓':detail.source=="2"?"京东":detail.source=="6"?"阿里巴巴":detail.source=="7"?"天猫":"未知"]]
  123. /[[freight]]</span></div>
  124. </div>
  125. </el-form-item>
  126. <template v-if="detail.specs">
  127. <el-form-item v-for="(item,i) in detail.specs.spec" :label="item.name+':'" :key="i">
  128. <div class="select" v-for="(items) in item.data"
  129. :class="{change:items.id==optionIds[i]}"
  130. @click="clickOptionIds(items,i)">
  131. <span>[[items.name]]</span>
  132. </div>
  133. </el-form-item>
  134. </template>
  135. </el-form>
  136. <el-button type="danger" v-if="detail.source==2" @click="toJD">查看第三方详情</el-button>
  137. </div>
  138. </div>
  139. <div style="margin:20px 0;border-bottom:1px solid #f11111;line-height:40px;">
  140. <div style="width:120px;text-align:center;background-color: #f11111;color:#fff;font-weight: 600;">商品详情</div>
  141. </div>
  142. <div>
  143. <div style="display:flex;font-size: 16px;color: #6b6b6b;">
  144. <div style="margin-right: 60px;">商家货号:[[detail.third_id]]</div>
  145. <div style="margin-right: 60px;">品牌:[[detail.third_brand_name]]</div>
  146. <div>商家名称:[[detail.shop_name]]</div>
  147. </div>
  148. <div class="description" v-html="detail.description">
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <script>
  155. var app = new Vue({
  156. el:"#app",
  157. delimiters: ['[[', ']]'],
  158. data() {
  159. return {
  160. stock:"",
  161. area:[],
  162. status:1,
  163. selectImg:0,
  164. rate: 5,
  165. value:null,
  166. value1:[],
  167. freight:'包邮',
  168. detail:{},
  169. optionIds:[],
  170. props:{
  171. label:"areaname",
  172. value:"areaname",
  173. lazy:true,
  174. lazyLoad:(node,resolve)=>{
  175. let parent_id = node.data?node.data.id:"";
  176. this.$http.post("{!! yzWebFullUrl('area.list') !!}",{parent_id}).then(res=>{
  177. if (res.data.result==1) {
  178. res.data.data.forEach(item=>item.leaf = node.level>1);
  179. resolve(res.data.data)
  180. }
  181. else this.$message.error(res.data.msg);
  182. })
  183. }
  184. }
  185. }
  186. },
  187. created(){
  188. this.getdata();
  189. },
  190. methods:{
  191. clickOptionIds(item,i){
  192. this.$set(this.optionIds,i,item.id);
  193. let a = this.optionIds.join("_");
  194. this.detail.specs.options.forEach(item=>{
  195. if(item.spec_value_ids==a){
  196. this.detail.cover = item.image||this.detail.cover;
  197. this.stock = item.stock;
  198. this.detail.agreement_price = item.agreement_price;
  199. this.detail.market_price = item.market_price;
  200. this.detail.activity_price = item.activity_price;
  201. this.detail.id = item.id;
  202. this.detail.third_id = item.third_id;
  203. }
  204. })
  205. if (this.value[2]) {
  206. this.getstatus();
  207. }
  208. },
  209. toJD(){
  210. window.open(`https://item.jd.com/${this.detail.third_id}.html`);
  211. },
  212. getstatus(){
  213. console.log(this.value);
  214. this.$http.post("{!! yzWebFullUrl('plugin.jd-supply.admin.goods-import.goods-stock') !!}",{
  215. goods_id:"{{ request()-> id }}",
  216. option_id:this.detail.id,
  217. province:this.value[0],
  218. city:this.value[1],
  219. district:this.value[2]
  220. }).then(res=>{
  221. if (res.data.result==1) {
  222. this.status = res.data.data.status;
  223. console.log(res.data.data.freight);
  224. if (res.data.data.freight > 0) {
  225. this.freight = '邮费:'+res.data.data.freight + '元'
  226. console.log(this.detail)
  227. }
  228. }
  229. else this.$message.error(res.data.msg);
  230. })
  231. },
  232. getdata(){
  233. let id = "{{ request()-> id }}";
  234. this.$http.post("{!! yzWebFullUrl('plugin.jd-supply.admin.goods-import.detail-data') !!}",{id}).then(res=>{
  235. if (res.data.result==1) {
  236. this.detail = res.data.data;
  237. console.log(this.detail);
  238. this.stock = this.detail.specs.options[0].stock;
  239. this.optionIds = this.detail.specs.options[0].spec_value_ids.split('_');
  240. this.detail.id = this.detail.specs.options[0].id;
  241. this.detail.third_id = this.detail.specs.options[0].third_id;
  242. }
  243. else this.$message.error(res.data.msg);
  244. })
  245. },
  246. controlImg(i){
  247. if (i<=0) i = 0;
  248. let len = this.detail.covers.length;
  249. if (i>=len-1) i = len-1;
  250. this.detail.cover = this.detail.covers[i];
  251. this.selectImg = i;
  252. let el = document.querySelector(".small-img");
  253. if (i<3||len<=5) el.style.left = "0px";
  254. else if(i>=len-3) el.style.left = (len-5)*-75+"px";
  255. else el.style.left = -i*75+150 + "px";
  256. }
  257. }
  258. })
  259. </script>
  260. @endsection('content')