index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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}}
  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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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://ysy-1329817240.cos.ap-guangzhou.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.setStorageSync('CompanyUserInfo',null);
  145. uni.navigateBack({
  146. delta:-1
  147. })
  148. }else{
  149. uni.showToast({
  150. icon:'none',
  151. title: res.msg,
  152. });
  153. }
  154. },
  155. rej => {}
  156. );
  157. },
  158. logout(){
  159. uni.showModal({
  160. title:"提示",
  161. content:"确认退出登录吗?",
  162. showCancel:true,
  163. cancelText:'取消',
  164. confirmText:'确定',
  165. success:res=>{
  166. if(res.confirm){
  167. uni.setStorageSync('CompanyUserToken',null);
  168. uni.navigateBack({
  169. delta:-1
  170. })
  171. }else{
  172. }
  173. }
  174. })
  175. },
  176. // 跳转页面
  177. navgetTo(url) {
  178. this.utils.isLogin().then(res => {
  179. if(res){
  180. uni.navigateTo({
  181. url: url
  182. })
  183. }
  184. })
  185. },
  186. }
  187. }
  188. </script>
  189. <style lang="scss">
  190. .content{
  191. margin: 20upx 0upx;
  192. padding: 0 20upx;
  193. .user-info{
  194. padding: 30upx;
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. .left{
  199. position: relative;
  200. display: flex;
  201. .head-img{
  202. width: 120upx;
  203. height: 120upx;
  204. border-radius: 50%;
  205. overflow: hidden;
  206. margin-right: 30upx;
  207. border: 4upx solid #FFFFFF;
  208. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  209. image{
  210. width: 100%;
  211. height: 100%;
  212. }
  213. }
  214. .name-phone{
  215. padding-top: 15upx;
  216. .name{
  217. font-size: 36upx;
  218. font-family: PingFang SC;
  219. font-weight: bold;
  220. color: #111111;
  221. line-height: 1;
  222. }
  223. .phone{
  224. font-size: 28upx;
  225. font-family: PingFang SC;
  226. font-weight: 500;
  227. color: #666666;
  228. line-height: 1;
  229. margin-top: 30upx;
  230. }
  231. }
  232. }
  233. .msg-box{
  234. padding: 5rpx 15upx;
  235. height: 30upx;
  236. line-height: 30upx;
  237. font-size: 22upx;
  238. font-family: PingFang SC;
  239. font-weight: 500;
  240. color: #FFFFFF;
  241. border-radius: 8rpx;
  242. background-color: #2BC7B9;
  243. }
  244. }
  245. .used-tools{
  246. box-sizing: border-box;
  247. background: #FFFFFF;
  248. border-radius: 16upx;
  249. padding: 40upx 30upx;
  250. .title{
  251. font-size: 32upx;
  252. font-family: PingFang SC;
  253. font-weight: bold;
  254. color: #222222;
  255. line-height: 1;
  256. }
  257. .tools-list{
  258. margin-top: 50upx;
  259. display: flex;
  260. flex-wrap: wrap;
  261. width: 100%;
  262. .item{
  263. box-sizing: border-box;
  264. width: 25%;
  265. display: flex;
  266. flex-direction: column;
  267. align-items: center;
  268. justify-content: center;
  269. margin-bottom: 50upx;
  270. position: relative;
  271. image{
  272. width: 44upx;
  273. height: 44upx;
  274. }
  275. .text{
  276. font-size: 24upx;
  277. font-family: PingFang SC;
  278. font-weight: 500;
  279. color: #111111;
  280. line-height: 1;
  281. margin-top: 20upx;
  282. }
  283. .contact-btn{
  284. display: inline-block;
  285. position: absolute;
  286. top: 0;
  287. left: 0;
  288. width: 100%;
  289. height: 100%;
  290. opacity: 0;
  291. }
  292. }
  293. }
  294. }
  295. .log-out{
  296. height: 80upx;
  297. line-height: 80upx;
  298. text-align: center;
  299. font-size: 26upx;
  300. font-family: PingFang SC;
  301. font-weight: 500;
  302. color: #666666;
  303. background: #FFFFFF;
  304. border-radius: 16upx;
  305. margin-top: 20upx;
  306. }
  307. }
  308. </style>