index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{utils.parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" >
  12. {{user.deptName?user.deptName:'暂无'}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <view class="item" @click="toCreateOrder()">
  20. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/order.png" mode=""></image>
  21. <text class="text">商品制单</text>
  22. </view>
  23. <view class="item" @click="toCreateCoupon()">
  24. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/icon_coupon.png" mode=""></image>
  25. <text class="text">制单优惠券</text>
  26. </view>
  27. <view class="item" @click="toPay()">
  28. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/money.png" mode=""></image>
  29. <text class="text">微信收款</text>
  30. </view>
  31. <!-- <view class="item" @click="alipay()">
  32. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/money.png" mode=""></image>
  33. <text class="text">支付宝收款</text>
  34. </view> -->
  35. <view class="item" @click="toOrder()">
  36. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/order.png" mode=""></image>
  37. <text class="text">我的订单</text>
  38. </view>
  39. <view class="item" @click="toPackage()">
  40. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/package.png" mode=""></image>
  41. <text class="text">商品套餐</text>
  42. </view>
  43. <view class="item" @click="toCoupon()">
  44. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/icon_coupon.png" mode=""></image>
  45. <text class="text">套餐优惠券</text>
  46. </view>
  47. <view class="item" @click="toPaywechat()">
  48. <image src="https://kuanyitang-1317640934.cos.ap-shanghai.myqcloud.com/app/image/wechat.png" mode=""></image>
  49. <text class="text">微信收款码</text>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 退出登录按钮 -->
  54. <view class="log-out" @click="logout">退出登录</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {getUserInfo,getQrImg} from '@/api/companyUser'
  60. export default {
  61. data() {
  62. return {
  63. user:null,
  64. };
  65. },
  66. onLoad() {
  67. console.log("onload")
  68. },
  69. onShow() {
  70. console.log("onshow")
  71. this.getUserInfo()
  72. },
  73. methods: {
  74. toPaywechat(){
  75. uni.navigateTo({
  76. url:'/pages_company/wechatcode?companyId='+this.user.companyId
  77. })
  78. },
  79. alipay(){
  80. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  81. // uni.setClipboardData({
  82. // data:url,
  83. // success:()=>{
  84. // uni.showToast({
  85. // title:'收款地址已复制到剪切板',
  86. // icon:'none'
  87. // })
  88. // }
  89. // });
  90. uni.navigateTo({
  91. url:'/pages_company/alipayImg'
  92. })
  93. },
  94. toCard(){
  95. uni.navigateTo({
  96. url:'/pages_company/card?cardId='+this.user.cardId
  97. })
  98. },
  99. toCreateOrder(){
  100. uni.navigateTo({
  101. url:'/pages_company/order/productList'
  102. })
  103. },
  104. toPay(){
  105. uni.navigateTo({
  106. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  107. })
  108. },
  109. toOrder(){
  110. uni.navigateTo({
  111. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  112. })
  113. },
  114. toPackage(){
  115. uni.navigateTo({
  116. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  117. })
  118. },
  119. toCoupon(){
  120. uni.navigateTo({
  121. url:'/pages_company/coupon'
  122. })
  123. },
  124. toCreateCoupon(){
  125. uni.navigateTo({
  126. url:'/pages_company/order/coupon'
  127. })
  128. },
  129. toCreateOrderCoupon(){
  130. uni.navigateTo({
  131. url:'/pages_company/order/coupon'
  132. })
  133. },
  134. getUserInfo(){
  135. var data={token:uni.getStorageSync('CompanyUserToken')}
  136. getUserInfo(data).then(
  137. res => {
  138. if(res.code==200){
  139. this.user=res.data;
  140. uni.setStorageSync('CompanyUserInfo',res.data)
  141. }
  142. else if(res.code==403){
  143. uni.setStorageSync('CompanyUserToken',null);
  144. uni.navigateBack({
  145. delta:-1
  146. })
  147. }else{
  148. uni.showToast({
  149. icon:'none',
  150. title: res.msg,
  151. });
  152. }
  153. },
  154. rej => {}
  155. );
  156. },
  157. logout(){
  158. uni.showModal({
  159. title:"提示",
  160. content:"确认退出登录吗?",
  161. showCancel:true,
  162. cancelText:'取消',
  163. confirmText:'确定',
  164. success:res=>{
  165. if(res.confirm){
  166. uni.setStorageSync('CompanyUserToken',null);
  167. uni.navigateBack({
  168. delta:-1
  169. })
  170. }else{
  171. }
  172. }
  173. })
  174. },
  175. // 跳转页面
  176. navgetTo(url) {
  177. this.utils.isLogin().then(res => {
  178. if(res){
  179. uni.navigateTo({
  180. url: url
  181. })
  182. }
  183. })
  184. },
  185. }
  186. }
  187. </script>
  188. <style lang="scss">
  189. .content{
  190. margin: 20upx 0upx;
  191. padding: 0 20upx;
  192. .user-info{
  193. padding: 30upx;
  194. display: flex;
  195. align-items: center;
  196. justify-content: space-between;
  197. .left{
  198. position: relative;
  199. display: flex;
  200. .head-img{
  201. width: 120upx;
  202. height: 120upx;
  203. border-radius: 50%;
  204. overflow: hidden;
  205. margin-right: 30upx;
  206. border: 4upx solid #FFFFFF;
  207. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  208. image{
  209. width: 100%;
  210. height: 100%;
  211. }
  212. }
  213. .name-phone{
  214. padding-top: 15upx;
  215. .name{
  216. font-size: 36upx;
  217. font-family: PingFang SC;
  218. font-weight: bold;
  219. color: #111111;
  220. line-height: 1;
  221. }
  222. .phone{
  223. font-size: 28upx;
  224. font-family: PingFang SC;
  225. font-weight: 500;
  226. color: #666666;
  227. line-height: 1;
  228. margin-top: 30upx;
  229. }
  230. }
  231. }
  232. .msg-box{
  233. padding: 5rpx 15upx;
  234. height: 40upx;
  235. line-height: 30upx;
  236. font-size: 22upx;
  237. font-family: PingFang SC;
  238. font-weight: 500;
  239. color: #FFFFFF;
  240. border-radius: 8rpx;
  241. background-color: #2BC7B9;
  242. }
  243. }
  244. .used-tools{
  245. box-sizing: border-box;
  246. background: #FFFFFF;
  247. border-radius: 16upx;
  248. padding: 40upx 30upx;
  249. .title{
  250. font-size: 32upx;
  251. font-family: PingFang SC;
  252. font-weight: bold;
  253. color: #222222;
  254. line-height: 1;
  255. }
  256. .tools-list{
  257. margin-top: 50upx;
  258. display: flex;
  259. flex-wrap: wrap;
  260. width: 100%;
  261. .item{
  262. box-sizing: border-box;
  263. width: 25%;
  264. display: flex;
  265. flex-direction: column;
  266. align-items: center;
  267. justify-content: center;
  268. margin-bottom: 50upx;
  269. position: relative;
  270. image{
  271. width: 44upx;
  272. height: 44upx;
  273. }
  274. .text{
  275. font-size: 24upx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #111111;
  279. line-height: 1;
  280. margin-top: 20upx;
  281. }
  282. .contact-btn{
  283. display: inline-block;
  284. position: absolute;
  285. top: 0;
  286. left: 0;
  287. width: 100%;
  288. height: 100%;
  289. opacity: 0;
  290. }
  291. }
  292. }
  293. }
  294. .log-out{
  295. height: 80upx;
  296. line-height: 80upx;
  297. text-align: center;
  298. font-size: 26upx;
  299. font-family: PingFang SC;
  300. font-weight: 500;
  301. color: #666666;
  302. background: #FFFFFF;
  303. border-radius: 16upx;
  304. margin-top: 20upx;
  305. }
  306. }
  307. </style>