index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }"
  3. :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  4. <tm-menubars title="搭配详情" :shadow="0" :showback="true"></tm-menubars>
  5. <div class="zhuti">
  6. <tm-sheet class="kuang" style="padding-bottom: 10px !important;">
  7. <view style="width: 94%;margin:0 auto;">
  8. <image class="chuanda" :src="alldata.image" mode="widthFix"></image>
  9. <!-- <view class="shuru" v-if="off==2">
  10. <tm-form>
  11. <view class="text-size-m text-white">请输入搭配名称</view>
  12. <tm-input v-model="familyname" name="title" clear placeholder="出席重要场合" clear></tm-input>
  13. </tm-form>
  14. </view>
  15. <view v-if="off==2" >
  16. <view class="biaoti text-white mt-30 text-size-m"><view class="mr-10"></view>分类</view>
  17. <tm-tabs class="C1b1b1b qiehuan" color="white" align="left" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
  18. <view class="biaoti text-white mt-30 text-size-m"><view class="mr-10"></view>场景</view>
  19. <tm-tabs class="C1b1b1b qiehuan" color="white" align="left" v-model="activeIndex1" :list="list1" range-key="title"></tm-tabs>
  20. </view> -->
  21. <view class="text-align-center mt-20 text-white">{{alldata.title}}</view>
  22. <!-- <view v-if="off==1" class="text-align-center mt-10 text-size-s">丝滑如肌肤</view> -->
  23. </view>
  24. </tm-sheet>
  25. </div>
  26. <view class="goumai shangpin" v-if="off==2">
  27. <view class="pt-20"><text class="ml-20">套装名</text><text class="fr mr-20 text-gray text-size-s">{{alldata.title}}</text></view>
  28. <view class="pa-20"><tm-cartCellListFood v-on:jiaruFun="jiarufuFun" v-for="item in test1" :typeclick="typeclick1" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood></view>
  29. </view>
  30. <tm-sheet :shadow="24" class="jiaoxi xiao" v-if="off==1">
  31. <tm-tabs align="center" class="qiehuan1" v-model="activeIndex" :list="list5" range-key="title"></tm-tabs>
  32. </tm-sheet>
  33. <!-- 单品 -->
  34. <view class="zhuti shangpin" v-if="off==1">
  35. <tm-sheet :padding="[0, 0]" class="jiaoxi xiao">
  36. <tm-cartCellListFood v-on:genghuan="genghuan" v-for="item in test" :typeclick="typeclick" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood>
  37. <tm-empty v-if="test.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
  38. </tm-sheet>
  39. </view>
  40. <view class="anniu" v-if="off==1">
  41. <tm-menu direction="top" :list="listmingri" @change="yuyue">
  42. <tm-button :round="24" theme="gray" size="n">预约明日</tm-button>
  43. </tm-menu>
  44. <tm-button :round="24"@click="chuku" class="fr" theme="primary" size="n">全部出库</tm-button>
  45. </view>
  46. <tm-poup v-model="show_1" :position="pos" class="tcc">
  47. <view style="position: relative !important;" v-if="chukudata.length !=0">
  48. <image @click="quxiao()" class="close" src="/static/img/close.png" mode="widthFix"></image>
  49. <view style="clear: both;"></view>
  50. <tm-swiper class="lunbohhh" @change="qiehuanLb" :current="current" :indicator-dots="false" :round="6" :ani3d="190" :autoplay="false" :list="list1"></tm-swiper>
  51. <view class="text-white text-align-center mt-15">{{chukudata[current].brand}}{{chukudata[current].color}}{{chukudata[current].goods_name}}</view>
  52. <view class="text-white text-align-center mt-10 text-size-s">{{chukudata[current].description}}</view>
  53. <image class="guayi" :src="chukudata[current].ygimage" mode="widthFix"></image>
  54. <view class="text-white text-align-center mt-15">衣物位于 {{chukudata[current].ygposition}} {{chukudata[current].is_have}}号衣柜</view>
  55. <view class="text-white text-align-center mt-15">
  56. <image class="aniOn deng" src="/static/img/101.png" mode="widthFix"></image>
  57. <text style="vertical-align: middle;">指示灯已亮,请取出衣柜</text>
  58. </view>
  59. <view class="daojishi">
  60. <text>倒计时:</text>
  61. <tm-countdown format="HH时MM分数SS秒哈" ref="testCountdown" :time="2*60*60*1000">
  62. <template
  63. v-slot:default=" { timeData } ">
  64. <view class="flex-center">
  65. <view v-for="(item,key) in timeData.data" :key="key" class="pa-10 primary mr-10 round-2" :class="$tm.vx.state().tmVuetify.black?'bk':''">
  66. {{item}}
  67. </view>
  68. </view>
  69. </template>
  70. </tm-countdown>
  71. <text>结束后若衣服仍未取出,出库将自动取消</text>
  72. </view>
  73. <!-- <view class="anniu">
  74. <tm-button @click="quxiao()" theme="gray" size="n">关闭弹框</tm-button>
  75. <tm-button @click="quxchuFun()" class="fr" theme="primary" size="n">取消出库</tm-button>
  76. </view> -->
  77. </view>
  78. </tm-poup>
  79. <!-- 弹出层消息 -->
  80. <tm-message ref="toast"></tm-message>
  81. </view>
  82. </template>
  83. <script>
  84. import{myRequest} from '@/api/request.js'
  85. export default {
  86. data() {
  87. return {
  88. familyname:'',
  89. off:1,
  90. alldata:0,
  91. list:['时尚','商务'],
  92. activeIndex:0,
  93. activeIndex:0,
  94. activeIndex1:0,
  95. list5:[ '搭配内的购物清单'],
  96. test: [],
  97. test1: [{
  98. img: '../../static/img/83.png',
  99. title: '丝缎质感纹理风衣',
  100. label: '黑色 - 6518/320',
  101. id: 3,
  102. buy: 0,
  103. itemId: 0
  104. }],
  105. typeclick1:3,//1加入购物车,2购物车,3前往购买,4,5
  106. typeclick:6,//1加入购物车,2购物车,3前往购买,4,5
  107. listmingri:[],
  108. show_1:false,
  109. pos:'center',
  110. chukudata:[],
  111. current:0,
  112. list1:[],
  113. mingriyuanList:[],
  114. qiu_id:''
  115. };
  116. },
  117. onLoad(e) {
  118. this.off=e.type?e.type:2;//1是自己的
  119. this.id=e.id?e.id:9;//1是自己的
  120. if(this.off==1){
  121. this.typeclick=6;
  122. this.getDate();
  123. this.getmingri();
  124. }else{
  125. this.getShp()
  126. }
  127. },
  128. created() {
  129. this.sys = uni.getSystemInfoSync();
  130. },
  131. methods: {
  132. jiarufuFun(data){
  133. uni.navigateTo({
  134. url: "/pages/shopdetail/index?cartId="+data.data.id+'&classId='+data.data.category_id,
  135. })
  136. },
  137. getShp(){
  138. var that=this;
  139. myRequest({
  140. url: "/api/Collocation/matchingSchemeDetails",
  141. method:'post',
  142. data:{id:that.id,type:1}
  143. }).then(res => {
  144. if (res.data.code == 200) {
  145. that.alldata=res.data.data.data;
  146. that.test1=[];
  147. res.data.data.details.forEach(item => {
  148. that.test1.push({
  149. img: item.shopGoods.image,
  150. title: item.shopGoods.goods_name,
  151. label: item.shopGoods.goods_details,
  152. id: item.shopGoods.id,
  153. buy: 0,
  154. itemId: 0,
  155. price:item.shopGoods.sale_price,
  156. category_id:item.shopGoods.category_id
  157. })
  158. })
  159. }else{
  160. }
  161. })
  162. },
  163. getmingri(){
  164. var that=this;
  165. myRequest({
  166. url: "/api/Scene/sceneList",
  167. method:'post',
  168. data:{}
  169. }).then(res => {
  170. if (res.data.code == 200) {
  171. var data=res.data.data;
  172. that.listmingri=[];
  173. for(let i=0;i<data.length;i++){
  174. that.listmingri.push(data[i].scene_name)
  175. }
  176. that.mingriyuanList=data;
  177. this.$forceUpdate()
  178. }else{
  179. }
  180. })
  181. },
  182. getDate(){
  183. var that=this;
  184. myRequest({
  185. url: "/api/Collocation/getCollocationDetails",
  186. method:'post',
  187. data:{id:that.id}
  188. }).then(res => {
  189. if (res.data.code == 200) {
  190. that.alldata=res.data.data.data;
  191. that.test=[];
  192. res.data.data.details.forEach(item => {
  193. that.test.push({
  194. img: item.goods.image,
  195. title: item.goods.goods_name,
  196. label: item.goods.description,
  197. goods_id:item.goods_id,
  198. price: 36.2,
  199. id: item.id,
  200. buy: 0
  201. })
  202. })
  203. }else{
  204. }
  205. })
  206. },
  207. yuyue(e){
  208. var that=this;
  209. var scene_id=that.mingriyuanList[e.index].id;
  210. myRequest({
  211. url: "/api/Collocation/makeAppointmentTomorrow",
  212. method:'post',
  213. data:{id:that.id,scene_id:scene_id}
  214. }).then(res => {
  215. if (res.data.code == 200) {
  216. that.$refs.toast.show({model:'success',label:'预约成功'})
  217. }else{
  218. that.$refs.toast.show({model:'error',label:res.data.msg})
  219. }
  220. })
  221. },
  222. quxchuFun(){
  223. var that=this;
  224. myRequest({
  225. url: "/api/Goods/cancelDelivery",
  226. method:'post',
  227. data:{qiu_id:that.qiu_id,id:that.chukudata[that.current].id}
  228. }).then(res => {
  229. if (res.data.code == 200) {
  230. that.show_1=false;
  231. that.$refs.toast.show({model:'success',label:res.data.msg})
  232. }else{
  233. that.$refs.toast.show({model:'error',label:res.data.msg})
  234. }
  235. })
  236. },
  237. quxiao(){
  238. this.show_1=false;
  239. },
  240. qiehuanLb(e){
  241. var that=this;
  242. this.current=e;
  243. },
  244. chuku(){
  245. var ids=[];
  246. var that=this;
  247. for(let i=0;i<this.test.length;i++){
  248. ids.push(this.test[i].goods_id)
  249. }
  250. myRequest({
  251. url: "/api/Goods/takeClothes",
  252. method:'post',
  253. data:{id:ids}
  254. }).then(res => {
  255. if (res.data.code == 200) {
  256. that.show_1=true;
  257. that.list1=[];
  258. that.chukudata=res.data.data.goodInfo;
  259. for(let i=0;i<res.data.data.goodInfo.length;i++){
  260. that.list1.push(res.data.data.goodInfo[i].image)
  261. }
  262. that.qiu_id=res.data.data.qiu_id;
  263. // 倒计时开始
  264. var countdownstart=Date.parse(new Date(res.data.data.stock_time))/1000;
  265. var countdownend=countdownstart+2*60*60;
  266. var countdownnow=Date.parse(new Date())/1000
  267. var daojishi=countdownend-countdownnow;
  268. if(daojishi<0){
  269. that.countdown=0;
  270. }else{
  271. that.countdown=daojishi*1000;
  272. }
  273. // 倒计时结束
  274. that.$refs.toast.show({model:'success',label:'出库成功'})
  275. }else{
  276. that.$refs.toast.show({model:'error',label:res.data.msg})
  277. }
  278. })
  279. },
  280. genghuan(data){
  281. var that=this;
  282. if(data.type==1){
  283. uni.navigateTo({
  284. url: "/pages/genghuan/index?goods_id="+data.data.goods_id+"&id="+data.data.id,
  285. })
  286. }else{
  287. // 出库
  288. var ids=[];
  289. ids.push(data.data.goods_id)
  290. myRequest({
  291. url: "/api/Goods/takeClothes",
  292. method:'post',
  293. data:{id:ids}
  294. }).then(res => {
  295. if (res.data.code == 200) {
  296. that.show_1=true;
  297. that.list1=[];
  298. that.chukudata=res.data.data.goodInfo;
  299. for(let i=0;i<res.data.data.goodInfo.length;i++){
  300. that.list1.push(res.data.data.goodInfo[i].image)
  301. }
  302. that.qiu_id=res.data.data.qiu_id;
  303. // 倒计时开始
  304. var countdownstart=Date.parse(new Date(res.data.data.stock_time))/1000;
  305. var countdownend=countdownstart+2*60*60;
  306. var countdownnow=Date.parse(new Date())/1000
  307. var daojishi=countdownend-countdownnow;
  308. if(daojishi<0){
  309. that.countdown=0;
  310. }else{
  311. that.countdown=daojishi*1000;
  312. }
  313. // 倒计时结束
  314. that.$refs.toast.show({model:'success',label:'出库成功'})
  315. }else{
  316. that.$refs.toast.show({model:'error',label:res.data.msg})
  317. }
  318. })
  319. }
  320. },
  321. },
  322. }
  323. </script>
  324. <style lang="scss">
  325. /deep/ .tm-menubars .body{
  326. background-color: #1b1b1b !important;
  327. }
  328. /deep/ .zhuti{padding: 10px 10px;}
  329. /deep/ .kuang{margin:0 !important;padding: 0px !important;}
  330. .chuanda{width: 100%;margin-top:10px;}
  331. .shuru{background: #0D0D0D;padding: 10px;margin-top: 20px;}
  332. /deep/ .shuru .grey-darken-5{
  333. background-color: #0d0d0d!important;
  334. padding: 0px !important;
  335. }
  336. .shuru{border:1px solid #303030;border-radius: 10px;}
  337. /deep/ .shuru .text-primary.bk{color:#303030 !important;}
  338. /deep/ .shuru .border-grey-darken-4-b-1{border-bottom:none !important;}
  339. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  340. /deep/ .qiehuan .tm-tabs-con-item-text{background: #303440;height: 26px;line-height: 26px;
  341. padding-left: 14px;padding-right: 14px;margin-top: 17%;border-radius: 20px;margin-left: 10px;}
  342. /deep/ .qiehuan .text-white{
  343. font-size: 14px;
  344. background: #0178FD;
  345. height: 26px;
  346. vertical-align: middle;
  347. line-height: 26px;
  348. border-radius: 20px;
  349. padding-left: 14px;
  350. padding-right: 14px;
  351. margin-top: 17%;
  352. }
  353. .biaoti view{width:5px;height:19px;background: #0178FD;float: left;border-radius: 10px;}
  354. /deep/ .qiehuan1 .text-primary{color: white !important;}
  355. /deep/ .jiaoxi{margin:0 !important;padding: 8px !important;}
  356. /deep/ .shangpin .white.bk{background-color:#1b1b1b!important;}
  357. /deep/ .shangpin .tm-cartCellListFood{padding: 0px 0px 5px 0px !important;
  358. margin-top: 5px !important;border-bottom: 1px solid #1B1B1B;}
  359. /deep/ .shangpin .border-t-1.bk{border-top:1px solid #1b1b1b!important;}
  360. /deep/ .shangpin .round-3{width:120px !important;height:110px !important;}
  361. /deep/ .shangpin .tm-cartCellListFood-img{width:120px !important;height:110px !important;}
  362. /deep/ .shangpin .title{color: white !important;}
  363. /deep/ .shangpin .text-red{color: white !important;}
  364. .sao{width: 88%;display: block;margin: 0 auto;padding-bottom: 60px;margin-top: 20px;}
  365. .goumai{background: #1B1B1B;margin-bottom: 10px;}
  366. .anniu{width: 70%;margin: 0 auto;margin-top: 20px;padding-bottom: 30px;}
  367. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  368. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  369. /deep/ .tcc uni-swiper{width: 100% !important;}
  370. /deep/ .uni-swiper-slides{width: 160px !important;}
  371. /deep/ .tcc .lunbohhh uni-image{width: 160px !important;}
  372. .tcc .guayi{width: 70% !important;display: block;margin:0 auto;margin-top:15px !important;}
  373. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  374. .aniOn{
  375. animation:doudong 0.5s linear infinite;
  376. background:linear-gradient();
  377. background: -webkit-linear-gradient();
  378. }
  379. @keyframes doudong {
  380. 0%{
  381. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  382. }
  383. 25%{
  384. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  385. }
  386. 50%{
  387. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  388. }
  389. 75%{
  390. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  391. }
  392. 100%{
  393. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  394. }
  395. }
  396. /deep/ .tcc .anniu .gray.bk{color: white !important;}
  397. .tcc .anniu{width: 88%;margin: 0 auto;margin-top: 20px;}
  398. /deep/ .close{width: 30px !important;height: 30px !important;float: right;right: 6px;}
  399. .daojishi{width: 90%;margin: 15px auto;font-size: 14px;}
  400. </style>