index.vue 11 KB

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