index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="衣柜" :shadow="0" :showback="true"></tm-menubars>
  4. <view class="C1b1b1b">
  5. <view class="dingwei ml-20" v-if="itemuser!=0">
  6. <image class="touxiang" style="vertical-align: middle;" src="/static/img/41.png" mode="widthFix"></image>
  7. <text style="vertical-align: middle;" class="text-size-m mr-20">{{itemuser.username}}的衣橱</text>
  8. <!-- <image @click="qiehuanFun" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image> -->
  9. <!-- <text @click="qiehuanFun" style="vertical-align: middle;" class="text-size-m">切换</text> -->
  10. </view>
  11. <view class="dingwei" v-if="itemuser==0">
  12. <text style="vertical-align: middle;" class="text-size-m mr-20">暂无家庭成员去添加</text>
  13. <image @click="tianjia" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. <!-- 推荐 -->
  17. <view class="zhuti">
  18. <!-- 衣橱 -->
  19. <tm-sheet class="yichu" style="margin-bottom: 70px !important;">
  20. <tm-tabs class="C1b1b1b qiehuan" @change="fenleichangeFun" color="white" align="left" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
  21. <view class="yiguicla black pa-6 ma-4 fl" :class="item.off==1?'C0178FD':''" v-for="(item,index) in quanbuList" @click="yifu(item,index)">
  22. <image :src="item.image" mode="widthFix"></image>
  23. <view :class="item.is_have==0?'text-gray':''" class="text-align-center text-size-m mt-8">{{item.brand}}</view>
  24. <view :class="item.is_have==0?'text-gray':''" class="text-align-center text-size-m mt-6 mb-6">{{item.goods_name}}</view>
  25. </view>
  26. <view style="clear: both;"></view>
  27. <view v-if="quanbuList.length<total" class="more ma-30 pt-40" @click="gengmore()">
  28. <image src="/static/img/30.png" mode="widthFix"></image>
  29. <text class="text-size-s">下拉加载更多~</text>
  30. </view>
  31. </tm-sheet>
  32. <view class="anniu">
  33. <tm-button @click="quxiao1" :round="24" class="fl" theme="gray" size="n">取消</tm-button>
  34. <tm-button :round="24" @click="shanchu" class="fl" theme="red" size="n">删除</tm-button>
  35. <tm-button :round="24" @click="chuku" class="fl" theme="primary" size="n">出库</tm-button>
  36. <tm-button :round="24" @click="baocun" class="fl" theme="primary" size="n">保存</tm-button>
  37. </view>
  38. <tm-poup v-model="show_1" :position="pos" class="tcc">
  39. <view style="position: relative !important;" v-if="chukudata.length !=0">
  40. <view style="height: 10px;"></view>
  41. <tm-swiper @change="qiehuanLb" :current="current" :indicator-dots="false" :round="6" :ani3d="190" :autoplay="false" :list="list1"></tm-swiper>
  42. <view class="text-white text-align-center mt-15">{{chukudata[current].brand}}{{chukudata[current].color}}{{chukudata[current].goods_name}}</view>
  43. <view class="text-white text-align-center mt-10 text-size-s">{{chukudata[current].description}}</view>
  44. <image class="guayi" :src="chukudata[current].ygimage" mode="widthFix"></image>
  45. <view class="text-white text-align-center mt-15">衣物位于 {{chukudata[current].ygposition}} {{chukudata[current].is_have}}号衣柜</view>
  46. <view class="text-white text-align-center mt-15">
  47. <image class="aniOn deng" src="/static/img/101.png" mode="widthFix"></image>
  48. <text style="vertical-align: middle;">指示灯已亮,请取出衣柜</text>
  49. </view>
  50. <view class="anniu">
  51. <tm-button @click="quxiao()" theme="gray" size="n">关闭弹框</tm-button>
  52. <tm-button @click="chuFun()" class="fr" theme="primary" size="n">取消出库</tm-button>
  53. </view>
  54. </view>
  55. </tm-poup>
  56. <!-- 弹出层消息 -->
  57. <tm-message ref="toast"></tm-message>
  58. <tm-dialog v-model="show" :content="content" @confirm="queren"></tm-dialog>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import{myRequest} from '@/api/request.js'
  64. export default {
  65. data() {
  66. return {
  67. itemuser:0,
  68. soso:'',
  69. activeIndex:0,
  70. list:[],
  71. list1:[],
  72. listlx:[],
  73. quanbuList:[],
  74. chooseindex:-1,
  75. pagesize:6,
  76. page:1,
  77. total:0,
  78. count:0,
  79. have:0,
  80. show:false,
  81. content:'',
  82. show_1:false,
  83. pos:'center',
  84. chukudata:[],
  85. ids:[],
  86. current:0
  87. };
  88. },
  89. onLoad() {
  90. console.log("111")
  91. },
  92. created() {
  93. this.sys = uni.getSystemInfoSync();
  94. console.log("222")
  95. this.getfenltext()
  96. this.fenleichange();
  97. },
  98. methods: {
  99. baocun(){
  100. uni.navigateTo({
  101. url: "/pages/zidingyi/index?type=1",
  102. })
  103. },
  104. shanchu(){
  105. // for(let i=0;i<this.quanbuList.length;i++){
  106. // this.quanbuList[i].off=false;
  107. // this.$forceUpdate()
  108. // }
  109. },
  110. qiehuanLb(e){
  111. var that=this;
  112. this.current=e;
  113. console.log(e)
  114. },
  115. queren(){
  116. var that=this;
  117. this.list1=[]
  118. myRequest({
  119. url: "/api/Goods/takeClothes",
  120. method:'post',
  121. data:{id:that.ids}
  122. }).then(res => {
  123. if (res.data.code == 200) {
  124. that.show_1=true;
  125. that.chukudata=res.data.data;
  126. for(let i=0;i<res.data.data.length;i++){
  127. that.list1.push(res.data.data[i].image)
  128. }
  129. that.$refs.toast.show({model:'success',label:'出库成功'})
  130. }else{
  131. that.$refs.toast.show({model:'error',label:res.data.msg})
  132. }
  133. })
  134. },
  135. quxiao1(){
  136. for(let i=0;i<this.quanbuList.length;i++){
  137. this.quanbuList[i].off=false;
  138. this.$forceUpdate()
  139. }
  140. },
  141. chuku(){
  142. var id=[],a=0;
  143. var that=this;
  144. if(this.quanbuList.length==0){
  145. that.$refs.toast.show({model:'error',label:'请选择衣物'})
  146. return
  147. }
  148. for(let i=0;i<this.quanbuList.length;i++){
  149. if(this.quanbuList[i].off){
  150. a=a+1;
  151. if(this.quanbuList[i].off && this.quanbuList[i].is_have !=0){
  152. id.push(this.quanbuList[i].id)
  153. }
  154. }
  155. }
  156. if(id.length==0){
  157. that.$refs.toast.show({model:'error',label:'请选择在库衣物'})
  158. return
  159. }
  160. this.content="有"+(a-id.length)+"衣物已经出库,在库衣物将添加至出库清单"
  161. this.ids=id;
  162. this.show=true;
  163. },
  164. sosoFun(){
  165. uni.navigateTo({
  166. url: "/pages/shopsoso/index",
  167. })
  168. },
  169. getfenltext(){
  170. var that=this;
  171. myRequest({
  172. url: "/api/Category/list",
  173. method:'post',
  174. data:{}
  175. }).then(res => {
  176. if (res.data.code == 200) {
  177. if(res.data.data.length != 0){
  178. that.list=['全部'];
  179. for(let i=0;i<res.data.data.length;i++){
  180. that.list.push(res.data.data[i].category_name)
  181. }
  182. that.listlx=res.data.data;
  183. }
  184. }else{
  185. that.list=[];
  186. that.listlx=[];
  187. }
  188. })
  189. },
  190. getList(){
  191. var that=this;
  192. myRequest({
  193. url: "/api/Goods/classificationData",
  194. method:'post',
  195. data:{role_id:that.itemuser.id,id:that.activeIndex,page:that.page,pagesize:that.pagesize}
  196. }).then(res => {
  197. if (res.data.code == 200) {
  198. if(res.data.data.length != 0){
  199. that.quanbuList=that.quanbuList.concat(res.data.data.data);
  200. for(let i=0;i<that.quanbuList.length;i++){
  201. that.quanbuList[i].off=false;
  202. }
  203. that.total=res.data.data.total;
  204. that.count=res.data.data.count;
  205. that.have=res.data.data.have;
  206. }
  207. }else{
  208. that.quanbuList=[];
  209. }
  210. })
  211. },
  212. fenleichangeFun(){
  213. this.page=1;
  214. this.quanbuList=[]
  215. this.getList()
  216. },
  217. fenleichange(){
  218. var that=this;
  219. myRequest({
  220. url: "/api/MemberInfo/getFamilyMember",
  221. method:'post',
  222. data:{family_id:uni.getStorageSync("family_id")}
  223. }).then(res => {
  224. console.log(res.data)
  225. if (res.data.code == 200) {
  226. if(res.data.data.length != 0){
  227. var wu=0;
  228. for(let i=0;i<res.data.data.length;i++){
  229. if(res.data.data[i].checked==1){
  230. wu=1;
  231. that.itemuser=res.data.data[i];
  232. }
  233. }
  234. if(wu==0){
  235. that.itemuser=res.data.data[0];
  236. }
  237. that.getList();
  238. }else{
  239. that.itemuser=0;
  240. }
  241. }else{
  242. that.itemuser=0;
  243. }
  244. })
  245. },
  246. yifu(item,index){
  247. item.off=!item.off;
  248. this.$forceUpdate()
  249. },
  250. qiehuanFun(){
  251. uni.navigateTo({
  252. url: "/pages/qiehuan/index",
  253. })
  254. },
  255. randouh(){
  256. let list2 = [],that=this;
  257. for(let i=0;i<6;i++){
  258. list2.push({
  259. src:'/static/img/47.png',
  260. text:'大号版型夹克',
  261. type:'新品',
  262. off:false
  263. })
  264. }
  265. this.quanbuList=this.quanbuList.concat(list2)
  266. console.log(this.quanbuList)
  267. },
  268. ruku(){
  269. uni.navigateTo({
  270. url: "/pages/putstorage/index",
  271. })
  272. },
  273. quxiao(){
  274. this.show_1=false;
  275. },
  276. },
  277. }
  278. </script>
  279. <style lang="scss">
  280. /deep/ uni-scroll-view{
  281. height: auto !important;
  282. }
  283. /deep/ .tm-menubars .body{
  284. background-color: #1b1b1b !important;
  285. }
  286. .shangright{
  287. padding: 10px;
  288. }
  289. //
  290. .xiangji image{
  291. width: 30px;
  292. height: 22px;
  293. }
  294. .suosou image{
  295. width: 40px;
  296. }
  297. /deep/ .icon-search{
  298. font-size: 23px !important;
  299. color: #8E8E93 !important;
  300. }
  301. /deep/ .tm-search{
  302. width: 94%;
  303. margin: 0 auto;
  304. background-color: #414141 !important;
  305. border-radius: 10px;
  306. }
  307. /deep/ .tm-search .grey-darken-5{
  308. background-color: #414141 !important;
  309. }
  310. .dingwei{padding-bottom: 20px;}
  311. .dingwei image{width: 25px;margin-right: 10px; }
  312. .dingwei .touxiang{width: 50px;margin-right: 3px; }
  313. /deep/ .lunbo1{margin:0 !important;padding: 4px !important;margin-top: 5px !important;width: 46.6% !important;}
  314. .tuijiantp{width: 100%;}
  315. .tuijiantp image{width: 97% !important;}
  316. .yichu{margin:0 !important;padding: 4px !important;margin-top: 10px !important;}
  317. /deep/ .qiehuan .text-white{
  318. font-size: 14px;
  319. background: #303440;
  320. height: 28px;
  321. vertical-align: middle;
  322. line-height: 28px;
  323. border-radius: 20px;
  324. padding-left: 14px;
  325. padding-right: 14px;
  326. margin-top: 17%;
  327. }
  328. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  329. .yiguicla image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;}
  330. .yiguicla{width: 30%;border-radius: 10px;}
  331. .more{text-align: center;}
  332. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  333. .fudong{position:fixed;right:10px;bottom:150px;background: #303030;width: 130px;height: 60px;
  334. border-radius: 30px 0px 0px 30px;font-size: 14px;text-align: center;}
  335. .fudimg{width: 60px;height:60px}
  336. .anniu{width: 100%;margin: 0 auto;padding-bottom: 30px;text-align: center;}
  337. /deep/ .tm-button .tm-button-btn uni-button{min-width: 77px !important;}
  338. /deep/ .tm-button .red{color: white !important;}
  339. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  340. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  341. /deep/ .tcc uni-swiper{width: 100% !important;}
  342. /deep/ .uni-swiper-slides{width: 160px !important;}
  343. /deep/ .tcc uni-image{width: 160px !important;}
  344. .tcc .guayi{width: 70% !important;display: block;margin:0 auto;margin-top:15px !important;}
  345. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  346. .aniOn{
  347. animation:doudong 0.5s linear infinite;
  348. background:linear-gradient();
  349. background: -webkit-linear-gradient();
  350. }
  351. @keyframes doudong {
  352. 0%{
  353. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  354. }
  355. 25%{
  356. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  357. }
  358. 50%{
  359. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  360. }
  361. 75%{
  362. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  363. }
  364. 100%{
  365. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  366. }
  367. }
  368. /deep/ .tcc .anniu .gray.bk{color: white !important;}
  369. .tcc .anniu{width: 88%;margin: 0 auto;margin-top: 20px;}
  370. </style>