goods-import-detail.blade.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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.yz-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.image_url" 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.id]]-[[optionIds]]</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/yz-supply/assent/image/sale.png')}}">
  96. <span style="color: #202020;font-size:16px;">已售出</span>
  97. </div>
  98. <div>[[detail.sales]]</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/yz-supply/assent/image/evaluate.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/yz-supply/assent/image/fontclass-kucun.png')}}">
  112. <span style="color: #202020;font-size:16px;">库存</span>
  113. </div>
  114. <div>[[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. [[detail.category_1.name]]--[[detail.category_2.name]]--[[detail.category_3.name]]
  121. </div>
  122. </el-form-item>
  123. <el-form-item label="配送至:">
  124. <div style="width:700px;display:flex;margin-left:10px;">
  125. <el-cascader @change="getstatus" v-model="value" :options="area" :props="props" ></el-cascader>
  126. <div style="margin-left:80px"><span style="margin-right:20px;">[[stock>0?"有货":"无货"]]</span>
  127. <span>[[detail.source=="1"?'云仓':detail.source=="2"?"京东":detail.source=="6"?"阿里巴巴":detail.source=="7"?"天猫":detail.source=="8"?"苏宁":detail.source=="0"?"中台":"其他"]]
  128. /[[detail.freight_type==3?"包邮":"不包邮"]]</span></div>
  129. </div>
  130. </el-form-item>
  131. <template v-if="detail.skus">
  132. <el-form-item label="商品规格" >
  133. <div class="select" v-for="(items,i) in detail.skus"
  134. :class="{change:items.id==optionIds}"
  135. @click="clickOptionIds(items,i)">
  136. <span>[[items.title]]</span>
  137. </div>
  138. </el-form-item>
  139. </template>
  140. </el-form>
  141. <div v-if="detail.third_id">
  142. <el-button type="danger" v-if="detail.source==2 || detail.source==7 || detail.source==8" @click="toThirdParty">查看第三方详情</el-button>
  143. </div>
  144. </div>
  145. </div>
  146. <div style="margin:20px 0;border-bottom:1px solid #f11111;line-height:40px;">
  147. <div style="width:120px;text-align:center;background-color: #f11111;color:#fff;font-weight: 600;">商品详情</div>
  148. </div>
  149. <div>
  150. <div style="display:flex;font-size: 16px;color: #6b6b6b;">
  151. <div style="margin-right: 60px;">下单号:[[detail.id]]-[[optionIds]]</div>
  152. <div style="margin-right: 60px;" v-if="detail.brand.name">品牌:[[detail.brand.name]]</div>
  153. <div v-if="detail.supplier.name">商家名称:[[detail.supplier.name]]</div>
  154. </div>
  155. <div class="description" v-html="detail.detail_images">
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <script>
  162. var app = new Vue({
  163. el:"#app",
  164. delimiters: ['[[', ']]'],
  165. data() {
  166. return {
  167. stock:"",
  168. sku_id:"",
  169. area:[],
  170. status:1,
  171. selectImg:0,
  172. rate: 5,
  173. value:null,
  174. value1:[],
  175. detail:{
  176. category_1:{
  177. name:"",
  178. },
  179. category_2:{
  180. name:"",
  181. },
  182. category_3:{
  183. name:"",
  184. },
  185. brand:{
  186. name:"",
  187. },
  188. supplier:{
  189. name:"",
  190. },
  191. },
  192. optionIds:[],
  193. props:{
  194. label:"areaname",
  195. value:"areaname",
  196. lazy:true,
  197. lazyLoad:(node,resolve)=>{
  198. let parent_id = node.data?node.data.id:"";
  199. this.$http.post("{!! yzWebFullUrl('area.list') !!}",{parent_id}).then(res=>{
  200. if (res.data.result==1) {
  201. res.data.data.forEach(item=>item.leaf = node.level>1);
  202. resolve(res.data.data)
  203. }
  204. else this.$message.error(res.data.msg);
  205. })
  206. }
  207. }
  208. }
  209. },
  210. created(){
  211. this.getdata();
  212. },
  213. methods:{
  214. clickOptionIds(item,i){
  215. this.optionIds = item.id;
  216. this.stock = item.stock;
  217. this.detail.agreement_price = item.price;
  218. this.detail.market_price = item.origin_price;
  219. this.detail.activity_price = item.activity_price;
  220. //
  221. // "title": "测试1-1+测试2-1",
  222. // "price": 0,
  223. // "cost_price": 0,
  224. // "origin_price": 0,
  225. // "guide_price": 0,
  226. // "activity_price": 0,
  227. // "stock": 0,
  228. // let a = this.optionIds.join("_");
  229. // this.detail.specs.options.forEach(item=>{
  230. // if(item.spec_value_ids==a){
  231. // this.detail.cover = item.image||this.detail.cover;
  232. // this.stock = item.stock;
  233. // this.detail.agreement_price = item.agreement_price;
  234. // this.detail.market_price = item.market_price;
  235. // this.detail.activity_price = item.activity_price;
  236. // }
  237. // })
  238. },
  239. toThirdParty(){
  240. if(this.detail.third_id == "" || this.detail.third_id == undefined){
  241. this.$message.error("来源暂无第三方ID,无法跳转第三方详情页面");
  242. return
  243. }
  244. switch (this.detail.source) {
  245. case 2:
  246. window.open('https://item.jd.com/'+this.detail.third_id+'.html');
  247. break
  248. case 7:
  249. window.open('https://item.taobao.com/item.htm?ft=t&id='+this.detail.third_id);
  250. break
  251. case 8:
  252. window.open('https://product.suning.com/0000000000/'+this.detail.third_id+'.html');
  253. break
  254. default:
  255. this.$message.error("商品来源暂无第三方地址");
  256. break;
  257. }
  258. },
  259. getstatus(){
  260. console.log(this.value);
  261. this.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.before-check') !!}",{
  262. goods_id:"{{ request()-> id }}",
  263. option_id:this.optionIds,
  264. province:this.value[0],
  265. city:this.value[1],
  266. district:this.value[2],
  267. middleground_configuration_id:"{{ request()-> middleground_configuration_id }}"
  268. }).then(res=>{
  269. if (res.data.result==1){
  270. this.$message.success(res.data.msg);
  271. } else this.$message.error(res.data.msg);
  272. })
  273. },
  274. getdata(){
  275. let id = "{{ request()-> id }}";
  276. let middleground_configuration_id = "{{ request()-> middleground_configuration_id }}";
  277. this.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.goods-import.detail-data') !!}",{id:id,middleground_configuration_id:middleground_configuration_id}).then(res=>{
  278. if (res.data.result==1) {
  279. this.detail = res.data.data;
  280. this.clickOptionIds(this.detail.skus[0]);
  281. }
  282. else this.$message.error(res.data.msg);
  283. })
  284. },
  285. controlImg(i){
  286. if (i<=0) i = 0;
  287. let len = this.detail.covers.length;
  288. if (i>=len-1) i = len-1;
  289. this.detail.image_url = this.detail.covers[i];
  290. this.selectImg = i;
  291. let el = document.querySelector(".small-img");
  292. if (i<3||len<=5) el.style.left = "0px";
  293. else if(i>=len-3) el.style.left = (len-5)*-75+"px";
  294. else el.style.left = -i*75+150 + "px";
  295. }
  296. }
  297. })
  298. </script>
  299. @endsection('content')