index.vue 11 KB

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