index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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="quxiao" :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" 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 :current="0" :indicator-dots="false" :round="6" :ani3d="190" :autoplay="false" :list="list1"></tm-swiper>
  42. <view class="text-white text-align-center mt-15">{{chukudata[0].brand}}{{chukudata[0].color}}{{chukudata[0].goods_name}}</view>
  43. <view class="text-white text-align-center mt-10 text-size-s">{{chukudata[0].description}}</view>
  44. <image class="guayi" :src="chukudata[0].ygimage" mode="widthFix"></image>
  45. <view class="text-white text-align-center mt-15">衣物位于 {{chukudata[0].ygposition}} {{chukudata[0].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. };
  87. },
  88. onLoad() {
  89. console.log("111")
  90. },
  91. created() {
  92. this.sys = uni.getSystemInfoSync();
  93. console.log("222")
  94. this.getfenltext()
  95. this.fenleichange();
  96. },
  97. methods: {
  98. shanchu(){
  99. // for(let i=0;i<this.quanbuList.length;i++){
  100. // this.quanbuList[i].off=false;
  101. // this.$forceUpdate()
  102. // }
  103. },
  104. queren(){
  105. var that=this;
  106. this.list1=[]
  107. myRequest({
  108. url: "/api/Goods/takeClothes",
  109. method:'post',
  110. data:{id:that.ids}
  111. }).then(res => {
  112. if (res.data.code == 200) {
  113. that.show_1=true;
  114. that.chukudata=res.data.data;
  115. for(let i=0;i<res.data.data.length;i++){
  116. that.list1.push(res.data.data[i].image)
  117. }
  118. that.$refs.toast.show({model:'success',label:'出库成功'})
  119. }else{
  120. that.$refs.toast.show({model:'error',label:res.data.msg})
  121. }
  122. })
  123. },
  124. quxiao(){
  125. for(let i=0;i<this.quanbuList.length;i++){
  126. this.quanbuList[i].off=false;
  127. this.$forceUpdate()
  128. }
  129. },
  130. chuku(){
  131. var id=[],a=0;
  132. if(this.quanbuList.length==0){
  133. that.$refs.toast.show({model:'error',label:'请选择衣物'})
  134. return
  135. }
  136. for(let i=0;i<this.quanbuList.length;i++){
  137. if(this.quanbuList[i].off){
  138. a=a+1;
  139. if(this.quanbuList[i].off && this.quanbuList[i].is_have !=0){
  140. id.push(this.quanbuList[i].id)
  141. }
  142. }
  143. }
  144. this.content="有"+(a-id.length)+"衣物已经出库,在库衣物将添加至出库清单"
  145. this.ids=id;
  146. this.show=true;
  147. },
  148. sosoFun(){
  149. uni.navigateTo({
  150. url: "/pages/shopsoso/index",
  151. })
  152. },
  153. getfenltext(){
  154. var that=this;
  155. myRequest({
  156. url: "/api/Category/list",
  157. method:'post',
  158. data:{}
  159. }).then(res => {
  160. if (res.data.code == 200) {
  161. if(res.data.data.length != 0){
  162. that.list=['全部'];
  163. for(let i=0;i<res.data.data.length;i++){
  164. that.list.push(res.data.data[i].category_name)
  165. }
  166. that.listlx=res.data.data;
  167. }
  168. }else{
  169. that.list=[];
  170. that.listlx=[];
  171. }
  172. })
  173. },
  174. getList(){
  175. var that=this;
  176. myRequest({
  177. url: "/api/Goods/classificationData",
  178. method:'post',
  179. data:{role_id:that.itemuser.id,id:that.activeIndex,page:that.page,pagesize:that.pagesize}
  180. }).then(res => {
  181. if (res.data.code == 200) {
  182. if(res.data.data.length != 0){
  183. that.quanbuList=that.quanbuList.concat(res.data.data.data);
  184. for(let i=0;i<that.quanbuList.length;i++){
  185. that.quanbuList[i].off=false;
  186. }
  187. that.total=res.data.data.total;
  188. that.count=res.data.data.count;
  189. that.have=res.data.data.have;
  190. }
  191. }else{
  192. that.quanbuList=[];
  193. }
  194. })
  195. },
  196. fenleichangeFun(){
  197. this.page=1;
  198. this.quanbuList=[]
  199. this.getList()
  200. },
  201. fenleichange(){
  202. var that=this;
  203. myRequest({
  204. url: "/api/MemberInfo/getFamilyMember",
  205. method:'post',
  206. data:{family_id:uni.getStorageSync("family_id")}
  207. }).then(res => {
  208. console.log(res.data)
  209. if (res.data.code == 200) {
  210. if(res.data.data.length != 0){
  211. var wu=0;
  212. for(let i=0;i<res.data.data.length;i++){
  213. if(res.data.data[i].checked==1){
  214. wu=1;
  215. that.itemuser=res.data.data[i];
  216. }
  217. }
  218. if(wu==0){
  219. that.itemuser=res.data.data[0];
  220. }
  221. that.getList();
  222. }else{
  223. that.itemuser=0;
  224. }
  225. }else{
  226. that.itemuser=0;
  227. }
  228. })
  229. },
  230. yifu(item,index){
  231. item.off=!item.off;
  232. this.$forceUpdate()
  233. },
  234. qiehuanFun(){
  235. uni.navigateTo({
  236. url: "/pages/qiehuan/index",
  237. })
  238. },
  239. randouh(){
  240. let list2 = [],that=this;
  241. for(let i=0;i<6;i++){
  242. list2.push({
  243. src:'/static/img/47.png',
  244. text:'大号版型夹克',
  245. type:'新品',
  246. off:false
  247. })
  248. }
  249. this.quanbuList=this.quanbuList.concat(list2)
  250. console.log(this.quanbuList)
  251. },
  252. ruku(){
  253. uni.navigateTo({
  254. url: "/pages/putstorage/index",
  255. })
  256. },
  257. quxiao(){
  258. this.show_1=false;
  259. },
  260. },
  261. }
  262. </script>
  263. <style lang="scss">
  264. /deep/ uni-scroll-view{
  265. height: auto !important;
  266. }
  267. /deep/ .tm-menubars .body{
  268. background-color: #1b1b1b !important;
  269. }
  270. .shangright{
  271. padding: 10px;
  272. }
  273. //
  274. .xiangji image{
  275. width: 30px;
  276. height: 22px;
  277. }
  278. .suosou image{
  279. width: 40px;
  280. }
  281. /deep/ .icon-search{
  282. font-size: 23px !important;
  283. color: #8E8E93 !important;
  284. }
  285. /deep/ .tm-search{
  286. width: 94%;
  287. margin: 0 auto;
  288. background-color: #414141 !important;
  289. border-radius: 10px;
  290. }
  291. /deep/ .tm-search .grey-darken-5{
  292. background-color: #414141 !important;
  293. }
  294. .dingwei{padding-bottom: 20px;}
  295. .dingwei image{width: 25px;margin-right: 10px; }
  296. .dingwei .touxiang{width: 50px;margin-right: 3px; }
  297. /deep/ .lunbo1{margin:0 !important;padding: 4px !important;margin-top: 5px !important;width: 46.6% !important;}
  298. .tuijiantp{width: 100%;}
  299. .tuijiantp image{width: 97% !important;}
  300. .yichu{margin:0 !important;padding: 4px !important;margin-top: 10px !important;}
  301. /deep/ .qiehuan .text-white{
  302. font-size: 14px;
  303. background: #303440;
  304. height: 28px;
  305. vertical-align: middle;
  306. line-height: 28px;
  307. border-radius: 20px;
  308. padding-left: 14px;
  309. padding-right: 14px;
  310. margin-top: 17%;
  311. }
  312. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  313. .yiguicla image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;}
  314. .yiguicla{width: 30%;border-radius: 10px;}
  315. .more{text-align: center;}
  316. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  317. .fudong{position:fixed;right:10px;bottom:150px;background: #303030;width: 130px;height: 60px;
  318. border-radius: 30px 0px 0px 30px;font-size: 14px;text-align: center;}
  319. .fudimg{width: 60px;height:60px}
  320. .anniu{width: 100%;margin: 0 auto;padding-bottom: 30px;text-align: center;}
  321. /deep/ .tm-button .tm-button-btn uni-button{min-width: 77px !important;}
  322. /deep/ .tm-button .red{color: white !important;}
  323. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  324. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  325. /deep/ .tcc uni-swiper{width: 100% !important;}
  326. /deep/ .uni-swiper-slides{width: 160px !important;}
  327. /deep/ .tcc uni-image{width: 160px !important;}
  328. .tcc .guayi{width: 70% !important;display: block;margin:0 auto;margin-top:15px !important;}
  329. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  330. .aniOn{
  331. animation:doudong 0.5s linear infinite;
  332. background:linear-gradient();
  333. background: -webkit-linear-gradient();
  334. }
  335. @keyframes doudong {
  336. 0%{
  337. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  338. }
  339. 25%{
  340. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  341. }
  342. 50%{
  343. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  344. }
  345. 75%{
  346. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  347. }
  348. 100%{
  349. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  350. }
  351. }
  352. /deep/ .tcc .anniu .gray.bk{color: white !important;}
  353. .tcc .anniu{width: 88%;margin: 0 auto;margin-top: 20px;}
  354. </style>