index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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. <view style="height: 10px;"></view>
  49. <tm-swiper @change="qiehuanLb" :current="current" :indicator-dots="false" :round="6" :ani3d="190" :autoplay="false" :list="list1"></tm-swiper>
  50. <view class="text-white text-align-center mt-15">{{chukudata[current].brand}}{{chukudata[current].color}}{{chukudata[current].goods_name}}</view>
  51. <view class="text-white text-align-center mt-10 text-size-s">{{chukudata[current].description}}</view>
  52. <image class="guayi" :src="chukudata[current].ygimage" mode="widthFix"></image>
  53. <view class="text-white text-align-center mt-15">衣物位于 {{chukudata[current].ygposition}} {{chukudata[current].is_have}}号衣柜</view>
  54. <view class="text-white text-align-center mt-15">
  55. <image class="aniOn deng" src="/static/img/101.png" mode="widthFix"></image>
  56. <text style="vertical-align: middle;">指示灯已亮,请取出衣柜</text>
  57. </view>
  58. <view class="anniu">
  59. <tm-button @click="quxiao()" theme="gray" size="n">关闭弹框</tm-button>
  60. <tm-button @click="quxchuFun()" class="fr" theme="primary" size="n">取消出库</tm-button>
  61. </view>
  62. </view>
  63. </tm-poup>
  64. <!-- 弹出层消息 -->
  65. <tm-message ref="toast"></tm-message>
  66. </view>
  67. </template>
  68. <script>
  69. import{myRequest} from '@/api/request.js'
  70. export default {
  71. data() {
  72. return {
  73. familyname:'',
  74. off:1,
  75. alldata:0,
  76. list:['时尚','商务'],
  77. activeIndex:0,
  78. activeIndex:0,
  79. activeIndex1:0,
  80. list5:[ '搭配内的购物清单'],
  81. test: [],
  82. test1: [{
  83. img: '../../static/img/83.png',
  84. title: '丝缎质感纹理风衣',
  85. label: '黑色 - 6518/320',
  86. id: 3,
  87. buy: 0,
  88. itemId: 0
  89. }],
  90. typeclick1:3,//1加入购物车,2购物车,3前往购买,4,5
  91. typeclick:6,//1加入购物车,2购物车,3前往购买,4,5
  92. listmingri:[],
  93. show_1:false,
  94. pos:'center',
  95. chukudata:[],
  96. current:0,
  97. list1:[],
  98. mingriyuanList:[]
  99. };
  100. },
  101. onLoad(e) {
  102. this.off=e.type?e.type:2;//1是自己的
  103. this.id=e.id?e.id:9;//1是自己的
  104. if(this.off==1){
  105. this.typeclick=6;
  106. this.getDate();
  107. this.getmingri();
  108. }else{
  109. this.getShp()
  110. }
  111. },
  112. created() {
  113. this.sys = uni.getSystemInfoSync();
  114. },
  115. methods: {
  116. jiarufuFun(data){
  117. uni.navigateTo({
  118. url: "/pages/shopdetail/index?cartId="+data.data.id+'&classId='+data.data.category_id,
  119. })
  120. },
  121. getShp(){
  122. var that=this;
  123. myRequest({
  124. url: "/api/Collocation/matchingSchemeDetails",
  125. method:'post',
  126. data:{id:that.id,type:1}
  127. }).then(res => {
  128. if (res.data.code == 200) {
  129. that.alldata=res.data.data.data;
  130. that.test1=[];
  131. res.data.data.details.forEach(item => {
  132. that.test1.push({
  133. img: item.shopGoods.image,
  134. title: item.shopGoods.goods_name,
  135. label: item.shopGoods.goods_details,
  136. id: item.shopGoods.id,
  137. buy: 0,
  138. itemId: 0,
  139. price:item.shopGoods.sale_price,
  140. category_id:item.shopGoods.category_id
  141. })
  142. })
  143. }else{
  144. }
  145. })
  146. },
  147. getmingri(){
  148. var that=this;
  149. myRequest({
  150. url: "/api/Scene/sceneList",
  151. method:'post',
  152. data:{}
  153. }).then(res => {
  154. if (res.data.code == 200) {
  155. var data=res.data.data;
  156. that.listmingri=[];
  157. for(let i=0;i<data.length;i++){
  158. that.listmingri.push(data[i].scene_name)
  159. }
  160. that.mingriyuanList=data;
  161. this.$forceUpdate()
  162. }else{
  163. }
  164. })
  165. },
  166. getDate(){
  167. var that=this;
  168. myRequest({
  169. url: "/api/Collocation/getCollocationDetails",
  170. method:'post',
  171. data:{id:that.id}
  172. }).then(res => {
  173. if (res.data.code == 200) {
  174. that.alldata=res.data.data.data;
  175. that.test=[];
  176. res.data.data.details.forEach(item => {
  177. that.test.push({
  178. img: item.goods.image,
  179. title: item.goods.goods_name,
  180. label: item.goods.description,
  181. goods_id:item.goods_id,
  182. price: 36.2,
  183. id: item.id,
  184. buy: 0
  185. })
  186. })
  187. }else{
  188. }
  189. })
  190. },
  191. yuyue(e){
  192. var that=this;
  193. var scene_id=that.mingriyuanList[e.index].id;
  194. myRequest({
  195. url: "/api/Collocation/makeAppointmentTomorrow",
  196. method:'post',
  197. data:{id:that.id,scene_id:scene_id}
  198. }).then(res => {
  199. if (res.data.code == 200) {
  200. that.$refs.toast.show({model:'success',label:'预约成功'})
  201. }else{
  202. that.$refs.toast.show({model:'error',label:res.data.msg})
  203. }
  204. })
  205. },
  206. quxchuFun(){
  207. var that=this;
  208. myRequest({
  209. url: "/api/Goods/cancelDelivery",
  210. method:'post',
  211. data:{qiu_id:that.qiuid,id:that.chukudata[that.current].id}
  212. }).then(res => {
  213. if (res.data.code == 200) {
  214. that.show_1=false;
  215. that.$refs.toast.show({model:'success',label:res.data.msg})
  216. }else{
  217. that.$refs.toast.show({model:'error',label:res.data.msg})
  218. }
  219. })
  220. },
  221. quxiao(){
  222. this.show_1=false;
  223. },
  224. qiehuanLb(e){
  225. var that=this;
  226. this.current=e;
  227. console.log(e)
  228. },
  229. chuku(){
  230. var ids=[];
  231. var that=this;
  232. for(let i=0;i<this.test.length;i++){
  233. ids.push(this.test[i].goods_id)
  234. }
  235. myRequest({
  236. url: "/api/Goods/takeClothes",
  237. method:'post',
  238. data:{id:ids}
  239. }).then(res => {
  240. if (res.data.code == 200) {
  241. that.show_1=true;
  242. that.chukudata=res.data.data;
  243. that.list1=[];
  244. for(let i=0;i<res.data.data.length;i++){
  245. that.qiuid=res.data.data[i].qiu_id
  246. that.list1.push(res.data.data[i].image)
  247. }
  248. that.$refs.toast.show({model:'success',label:'出库成功'})
  249. }else{
  250. that.$refs.toast.show({model:'error',label:res.data.msg})
  251. }
  252. })
  253. },
  254. genghuan(data){
  255. var that=this;
  256. if(data.type==1){
  257. uni.navigateTo({
  258. url: "/pages/genghuan/index?goods_id="+data.data.goods_id+"&id="+data.data.id,
  259. })
  260. }else{
  261. // 出库
  262. var ids=[];
  263. ids.push(data.data.goods_id)
  264. myRequest({
  265. url: "/api/Goods/takeClothes",
  266. method:'post',
  267. data:{id:ids}
  268. }).then(res => {
  269. if (res.data.code == 200) {
  270. that.show_1=true;
  271. that.chukudata=res.data.data;
  272. that.list1=[];
  273. for(let i=0;i<res.data.data.length;i++){
  274. that.qiuid=res.data.data[i].qiu_id
  275. that.list1.push(res.data.data[i].image)
  276. }
  277. that.$refs.toast.show({model:'success',label:'出库成功'})
  278. }else{
  279. that.$refs.toast.show({model:'error',label:res.data.msg})
  280. }
  281. })
  282. }
  283. },
  284. },
  285. }
  286. </script>
  287. <style lang="scss">
  288. /deep/ .tm-menubars .body{
  289. background-color: #1b1b1b !important;
  290. }
  291. /deep/ .zhuti{padding: 10px 10px;}
  292. /deep/ .kuang{margin:0 !important;padding: 0px !important;}
  293. .chuanda{width: 100%;margin-top:10px;}
  294. .shuru{background: #0D0D0D;padding: 10px;margin-top: 20px;}
  295. /deep/ .shuru .grey-darken-5{
  296. background-color: #0d0d0d!important;
  297. padding: 0px !important;
  298. }
  299. .shuru{border:1px solid #303030;border-radius: 10px;}
  300. /deep/ .shuru .text-primary.bk{color:#303030 !important;}
  301. /deep/ .shuru .border-grey-darken-4-b-1{border-bottom:none !important;}
  302. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  303. /deep/ .qiehuan .tm-tabs-con-item-text{background: #303440;height: 26px;line-height: 26px;
  304. padding-left: 14px;padding-right: 14px;margin-top: 17%;border-radius: 20px;margin-left: 10px;}
  305. /deep/ .qiehuan .text-white{
  306. font-size: 14px;
  307. background: #0178FD;
  308. height: 26px;
  309. vertical-align: middle;
  310. line-height: 26px;
  311. border-radius: 20px;
  312. padding-left: 14px;
  313. padding-right: 14px;
  314. margin-top: 17%;
  315. }
  316. .biaoti view{width:5px;height:19px;background: #0178FD;float: left;border-radius: 10px;}
  317. /deep/ .qiehuan1 .text-primary{color: white !important;}
  318. /deep/ .jiaoxi{margin:0 !important;padding: 8px !important;}
  319. /deep/ .shangpin .white.bk{background-color:#1b1b1b!important;}
  320. /deep/ .shangpin .tm-cartCellListFood{padding: 0px 0px 5px 0px !important;
  321. margin-top: 5px !important;border-bottom: 1px solid #1B1B1B;}
  322. /deep/ .shangpin .border-t-1.bk{border-top:1px solid #1b1b1b!important;}
  323. /deep/ .shangpin .round-3{width:120px !important;height:110px !important;}
  324. /deep/ .shangpin .tm-cartCellListFood-img{width:120px !important;height:110px !important;}
  325. /deep/ .shangpin .title{color: white !important;}
  326. /deep/ .shangpin .text-red{color: white !important;}
  327. .sao{width: 88%;display: block;margin: 0 auto;padding-bottom: 60px;margin-top: 20px;}
  328. .goumai{background: #1B1B1B;margin-bottom: 10px;}
  329. .anniu{width: 70%;margin: 0 auto;margin-top: 20px;padding-bottom: 30px;}
  330. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  331. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  332. /deep/ .tcc uni-swiper{width: 100% !important;}
  333. /deep/ .uni-swiper-slides{width: 160px !important;}
  334. /deep/ .tcc uni-image{width: 160px !important;}
  335. .tcc .guayi{width: 70% !important;display: block;margin:0 auto;margin-top:15px !important;}
  336. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  337. .aniOn{
  338. animation:doudong 0.5s linear infinite;
  339. background:linear-gradient();
  340. background: -webkit-linear-gradient();
  341. }
  342. @keyframes doudong {
  343. 0%{
  344. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  345. }
  346. 25%{
  347. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  348. }
  349. 50%{
  350. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  351. }
  352. 75%{
  353. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  354. }
  355. 100%{
  356. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  357. }
  358. }
  359. /deep/ .tcc .anniu .gray.bk{color: white !important;}
  360. .tcc .anniu{width: 88%;margin: 0 auto;margin-top: 20px;}
  361. </style>