index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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",
  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. })
  141. })
  142. }else{
  143. }
  144. })
  145. },
  146. getmingri(){
  147. var that=this;
  148. myRequest({
  149. url: "/api/Scene/sceneList",
  150. method:'post',
  151. data:{}
  152. }).then(res => {
  153. if (res.data.code == 200) {
  154. var data=res.data.data;
  155. that.listmingri=[];
  156. for(let i=0;i<data.length;i++){
  157. that.listmingri.push(data[i].scene_name)
  158. }
  159. that.mingriyuanList=data;
  160. this.$forceUpdate()
  161. }else{
  162. }
  163. })
  164. },
  165. getDate(){
  166. var that=this;
  167. myRequest({
  168. url: "/api/Collocation/getCollocationDetails",
  169. method:'post',
  170. data:{id:that.id}
  171. }).then(res => {
  172. if (res.data.code == 200) {
  173. that.alldata=res.data.data.data;
  174. that.test=[];
  175. res.data.data.details.forEach(item => {
  176. that.test.push({
  177. img: item.goods.image,
  178. title: item.goods.goods_name,
  179. label: item.goods.description,
  180. goods_id:item.goods_id,
  181. price: 36.2,
  182. id: item.id,
  183. buy: 0
  184. })
  185. })
  186. }else{
  187. }
  188. })
  189. },
  190. yuyue(e){
  191. var that=this;
  192. var scene_id=that.mingriyuanList[e.index].id;
  193. myRequest({
  194. url: "/api/Collocation/makeAppointmentTomorrow",
  195. method:'post',
  196. data:{id:that.id,scene_id:scene_id}
  197. }).then(res => {
  198. if (res.data.code == 200) {
  199. that.$refs.toast.show({model:'success',label:'预约成功'})
  200. }else{
  201. that.$refs.toast.show({model:'error',label:res.data.msg})
  202. }
  203. })
  204. },
  205. quxchuFun(){
  206. var that=this;
  207. myRequest({
  208. url: "/api/Goods/cancelDelivery",
  209. method:'post',
  210. data:{qiu_id:that.qiuid,id:that.chukudata[that.current].id}
  211. }).then(res => {
  212. if (res.data.code == 200) {
  213. that.show_1=false;
  214. that.$refs.toast.show({model:'success',label:res.data.msg})
  215. }else{
  216. that.$refs.toast.show({model:'error',label:res.data.msg})
  217. }
  218. })
  219. },
  220. quxiao(){
  221. this.show_1=false;
  222. },
  223. qiehuanLb(e){
  224. var that=this;
  225. this.current=e;
  226. console.log(e)
  227. },
  228. chuku(){
  229. var ids=[];
  230. var that=this;
  231. for(let i=0;i<this.test.length;i++){
  232. ids.push(this.test[i].goods_id)
  233. }
  234. myRequest({
  235. url: "/api/Goods/takeClothes",
  236. method:'post',
  237. data:{id:ids}
  238. }).then(res => {
  239. if (res.data.code == 200) {
  240. that.show_1=true;
  241. that.chukudata=res.data.data;
  242. that.list1=[];
  243. for(let i=0;i<res.data.data.length;i++){
  244. that.qiuid=res.data.data[i].qiu_id
  245. that.list1.push(res.data.data[i].image)
  246. }
  247. that.$refs.toast.show({model:'success',label:'出库成功'})
  248. }else{
  249. that.$refs.toast.show({model:'error',label:res.data.msg})
  250. }
  251. })
  252. },
  253. genghuan(data){
  254. var that=this;
  255. if(data.type==1){
  256. uni.navigateTo({
  257. url: "/pages/genghuan/index?goods_id="+data.data.goods_id+"&id="+data.data.id,
  258. })
  259. }else{
  260. // 出库
  261. var ids=[];
  262. ids.push(data.data.goods_id)
  263. myRequest({
  264. url: "/api/Goods/takeClothes",
  265. method:'post',
  266. data:{id:ids}
  267. }).then(res => {
  268. if (res.data.code == 200) {
  269. that.show_1=true;
  270. that.chukudata=res.data.data;
  271. that.list1=[];
  272. for(let i=0;i<res.data.data.length;i++){
  273. that.qiuid=res.data.data[i].qiu_id
  274. that.list1.push(res.data.data[i].image)
  275. }
  276. that.$refs.toast.show({model:'success',label:'出库成功'})
  277. }else{
  278. that.$refs.toast.show({model:'error',label:res.data.msg})
  279. }
  280. })
  281. }
  282. },
  283. },
  284. }
  285. </script>
  286. <style lang="scss">
  287. /deep/ .tm-menubars .body{
  288. background-color: #1b1b1b !important;
  289. }
  290. /deep/ .zhuti{padding: 10px 10px;}
  291. /deep/ .kuang{margin:0 !important;padding: 0px !important;}
  292. .chuanda{width: 100%;margin-top:10px;}
  293. .shuru{background: #0D0D0D;padding: 10px;margin-top: 20px;}
  294. /deep/ .shuru .grey-darken-5{
  295. background-color: #0d0d0d!important;
  296. padding: 0px !important;
  297. }
  298. .shuru{border:1px solid #303030;border-radius: 10px;}
  299. /deep/ .shuru .text-primary.bk{color:#303030 !important;}
  300. /deep/ .shuru .border-grey-darken-4-b-1{border-bottom:none !important;}
  301. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  302. /deep/ .qiehuan .tm-tabs-con-item-text{background: #303440;height: 26px;line-height: 26px;
  303. padding-left: 14px;padding-right: 14px;margin-top: 17%;border-radius: 20px;margin-left: 10px;}
  304. /deep/ .qiehuan .text-white{
  305. font-size: 14px;
  306. background: #0178FD;
  307. height: 26px;
  308. vertical-align: middle;
  309. line-height: 26px;
  310. border-radius: 20px;
  311. padding-left: 14px;
  312. padding-right: 14px;
  313. margin-top: 17%;
  314. }
  315. .biaoti view{width:5px;height:19px;background: #0178FD;float: left;border-radius: 10px;}
  316. /deep/ .qiehuan1 .text-primary{color: white !important;}
  317. /deep/ .jiaoxi{margin:0 !important;padding: 8px !important;}
  318. /deep/ .shangpin .white.bk{background-color:#1b1b1b!important;}
  319. /deep/ .shangpin .tm-cartCellListFood{padding: 0px 0px 5px 0px !important;
  320. margin-top: 5px !important;border-bottom: 1px solid #1B1B1B;}
  321. /deep/ .shangpin .border-t-1.bk{border-top:1px solid #1b1b1b!important;}
  322. /deep/ .shangpin .round-3{width:120px !important;height:110px !important;}
  323. /deep/ .shangpin .tm-cartCellListFood-img{width:120px !important;height:110px !important;}
  324. /deep/ .shangpin .title{color: white !important;}
  325. /deep/ .shangpin .text-red{color: white !important;}
  326. .sao{width: 88%;display: block;margin: 0 auto;padding-bottom: 60px;margin-top: 20px;}
  327. .goumai{background: #1B1B1B;margin-bottom: 10px;}
  328. .anniu{width: 70%;margin: 0 auto;margin-top: 20px;padding-bottom: 30px;}
  329. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  330. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  331. /deep/ .tcc uni-swiper{width: 100% !important;}
  332. /deep/ .uni-swiper-slides{width: 160px !important;}
  333. /deep/ .tcc uni-image{width: 160px !important;}
  334. .tcc .guayi{width: 70% !important;display: block;margin:0 auto;margin-top:15px !important;}
  335. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  336. .aniOn{
  337. animation:doudong 0.5s linear infinite;
  338. background:linear-gradient();
  339. background: -webkit-linear-gradient();
  340. }
  341. @keyframes doudong {
  342. 0%{
  343. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  344. }
  345. 25%{
  346. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  347. }
  348. 50%{
  349. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  350. }
  351. 75%{
  352. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  353. }
  354. 100%{
  355. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  356. }
  357. }
  358. /deep/ .tcc .anniu .gray.bk{color: white !important;}
  359. .tcc .anniu{width: 88%;margin: 0 auto;margin-top: 20px;}
  360. </style>